-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[admin] extract stats handlers to separate file #10750
Conversation
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: Erica Manno <erica.manno@gmail.com>
@rulex123 Please merge master to fix clang-tidy build problem. |
Signed-off-by: Erica Manno <erica.manno@gmail.com>
|
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Sorry, can you do a master merge? I was going to do a quick check to see if I patched your source/... changes without your test/... changes do they pass. |
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: Erica Manno <erica.manno@gmail.com>
@jmarantz merged master |
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.
This basically looks fine modulo the class-naming and a request to clean up a static regex while you're in here.
I mostly scanned through and I also patched this PR into a clean client, reverting the tests, to make sure the old tests work with new code (modulo a class-name change.
source/server/http/stats_handler.cc
Outdated
|
||
const uint64_t RecentLookupsCapacity = 100; | ||
|
||
const std::regex PromRegex("[^a-zA-Z0-9_]"); |
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.
no static non-pods
https://github.com/envoyproxy/envoy/blob/master/STYLE.md
The Google C++ style guide points out that non-PoD static and global variables are forbidden. This includes types such as std::string. We encourage the use of the advice in the C++ FAQ on the static initialization fiasco for how to best handle this.
also this should be in an anon-namespace or declared with static to reduce visibility, but you'll have to use the ref'd pattern to initialize.
I see this was in the old code too, but could fix while you are here?
source/server/http/stats_handler.h
Outdated
namespace Envoy { | ||
namespace Server { | ||
|
||
class StatsHandlerImpl { |
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.
This is not implementing an interface, so I'd just call it StatsHandler.
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: Erica Manno <erica.manno@gmail.com>
@jmarantz addressed your feedback |
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.
@envoyproxy/senior-maintainers
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.
Thank you!!!
Signed-off-by: Erica Manno <erica.manno@gmail.com> Signed-off-by: pengg <pengg@google.com>
Signed-off-by: Erica Manno erica.manno@gmail.com
Description: extract stats-related handlers from
admin.h|cc
and into separate class (part of #5505 )Risk Level: low
Testing: pre-existing tests
Docs Changes: n/a
Release Notes: n/a