Skip to content
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

Merged
merged 9 commits into from
Apr 20, 2020

Conversation

rulex123
Copy link
Contributor

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

Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: Erica Manno <erica.manno@gmail.com>
@rulex123 rulex123 changed the title [admin] extract stats handlers to separate class [admin] extract stats handlers to separate file Apr 15, 2020
@yanavlasov
Copy link
Contributor

@rulex123 Please merge master to fix clang-tidy build problem.

Signed-off-by: Erica Manno <erica.manno@gmail.com>
@rulex123
Copy link
Contributor Author

rulex123 commented Apr 16, 2020

I merged master but there still seems to be a clang-tidy problem with the build pipelines.

Signed-off-by: Erica Manno <erica.manno@gmail.com>
@jmarantz
Copy link
Contributor

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>
@rulex123
Copy link
Contributor Author

@jmarantz merged master

Copy link
Contributor

@jmarantz jmarantz left a 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.


const uint64_t RecentLookupsCapacity = 100;

const std::regex PromRegex("[^a-zA-Z0-9_]");
Copy link
Contributor

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?

namespace Envoy {
namespace Server {

class StatsHandlerImpl {
Copy link
Contributor

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>
@rulex123
Copy link
Contributor Author

@jmarantz addressed your feedback

Copy link
Contributor

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

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

@envoyproxy/senior-maintainers

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thank you!!!

@mattklein123 mattklein123 merged commit b9297ae into envoyproxy:master Apr 20, 2020
penguingao pushed a commit to penguingao/envoy that referenced this pull request Apr 22, 2020
Signed-off-by: Erica Manno <erica.manno@gmail.com>
Signed-off-by: pengg <pengg@google.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.

4 participants