Skip to content

stats: common tools that used for stats API migration#45968

Open
wbpcode wants to merge 3 commits into
envoyproxy:mainfrom
wbpcode:dev-imigrate-to-new-stats-api-common
Open

stats: common tools that used for stats API migration#45968
wbpcode wants to merge 3 commits into
envoyproxy:mainfrom
wbpcode:dev-imigrate-to-new-stats-api-common

Conversation

@wbpcode

@wbpcode wbpcode commented Jul 3, 2026

Copy link
Copy Markdown
Member

Commit Message: stats: common tools that used for stats API migration
Additional Description:

Common parts before migration stats API. This PR self only added new tools and change nothing to exiting code.

Risk Level: low.
Testing: unit.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds reusable helpers to support migrating stats construction toward tag-aware APIs without allocating per-owner sub-scopes, while preserving legacy flat stat name output for compatibility.

Changes:

  • Introduce TaggedStatNamePrefix plus Utility::*FromTaggedPrefix helpers to build tagged stats from pre-encoded prefixes/tags.
  • Add mergeStatPrefix() (new prefix_utility) to combine parent + owner prefixes into a single TaggedStatNamePrefix while keeping flat names byte-identical to legacy POOL_*_PREFIX.
  • Extend tests and BUILD targets to cover the new utilities and macro pathways.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/common/stats/utility_test.cc Adds unit tests for *FromTaggedPrefix helpers and TaggedStatNamePrefix accessors.
test/common/stats/prefix_utility_test.cc New unit tests validating mergeStatPrefix() behavior vs legacy prefix joining across scenarios.
test/common/stats/BUILD Registers the new prefix_utility_test target.
source/common/stats/utility.h Adds TaggedStatNamePrefix and declares Utility::*FromTaggedPrefix APIs.
source/common/stats/utility.cc Implements the Utility::*FromTaggedPrefix helpers.
source/common/stats/symbol_table.h Adds StatNamePool::reserve() to pre-allocate pool storage.
source/common/stats/prefix_utility.h Declares mergeStatPrefix() API for composing tagged prefixes.
source/common/stats/prefix_utility.cc Implements mergeStatPrefix() and parent-tag extraction logic.
source/common/stats/BUILD Adds prefix_utility_lib build target.
envoy/stats/stats_macros.h Adds POOL_*_TAGGED(_PREFIX) macros that use the new tagged-prefix utility APIs.

Comment thread source/common/stats/prefix_utility.cc Outdated
@wbpcode wbpcode force-pushed the dev-imigrate-to-new-stats-api-common branch from fe435e9 to b69d921 Compare July 3, 2026 17:18
@wbpcode

wbpcode commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

/retest

@wbpcode wbpcode force-pushed the dev-imigrate-to-new-stats-api-common branch from b69d921 to 7ccbd17 Compare July 4, 2026 02:11
@wbpcode wbpcode requested a review from Copilot July 4, 2026 02:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread source/common/stats/prefix_utility.cc
Comment thread source/common/stats/prefix_utility.cc Outdated
Comment thread source/common/stats/prefix_utility.h Outdated
@wbpcode

wbpcode commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

/retest

Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
@wbpcode wbpcode force-pushed the dev-imigrate-to-new-stats-api-common branch from d54c6f1 to 56d8da1 Compare July 4, 2026 05:49
@wbpcode

wbpcode commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

/retest

wbpcode added 2 commits July 4, 2026 09:15
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants