-
Notifications
You must be signed in to change notification settings - Fork 5.2k
dynamic_modules: add stats access APIs to Bootstrap Extension #43029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fba9c61 to
1c63ab4
Compare
| * @param iterator_fn is the callback function to call for each gauge. | ||
| * @param user_data is the user data to pass to the callback function. | ||
| */ | ||
| void envoy_dynamic_module_callback_bootstrap_extension_iterate_gauges( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is actually nice
|
|
||
| // Iterate over all counters to find the one with matching name. | ||
| bool found = false; | ||
| stats_store.forEachCounter([](size_t) {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wait is there no way to lookup faster than O(n)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there isn't :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think I can use iterate() instead and exit early. Let me switch to that. That will let us do it in O(k) instead of a full scan.
Signed-off-by: Rohit Agrawal <[email protected]>
1c63ab4 to
94bc7e7
Compare
Description
This PR adds stats access APIs to the Bootstrap Extension.
Commit Message: dynamic_modules: add stats access APIs to Bootstrap Extension
Additional Description: Added stats access APIs to the Bootstrap Extension.
Risk Level: Low
Testing: Added Tests
Docs Changes: N/A
Release Notes: N/A