stats: common tools that used for stats API migration#45968
Open
wbpcode wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
TaggedStatNamePrefixplusUtility::*FromTaggedPrefixhelpers to build tagged stats from pre-encoded prefixes/tags. - Add
mergeStatPrefix()(newprefix_utility) to combine parent + owner prefixes into a singleTaggedStatNamePrefixwhile keeping flat names byte-identical to legacyPOOL_*_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. |
fe435e9 to
b69d921
Compare
Member
Author
|
/retest |
b69d921 to
7ccbd17
Compare
Member
Author
|
/retest |
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
d54c6f1 to
56d8da1
Compare
Member
Author
|
/retest |
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.