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

Http Conn Man: Per Listener downstream_rq_*xx stats #1783

Merged
merged 9 commits into from
Oct 3, 2017
Merged

Conversation

ccaraman
Copy link
Contributor

@ccaraman ccaraman commented Sep 29, 2017

Expose the listener stats scope to Http Connection Manager and increment the downstream_rq stats for 2xx, 3xx, 4xx, and 5xx.

Signed-off-by: Constance Caramanolis ccaramanolis@lyft.com

/**
* @return ConnectionManagerStats& the listener stats to write to.
*/
virtual ConnectionManagerStats& listenerStats() PURE;
Copy link
Member

Choose a reason for hiding this comment

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

Unless you are going to increment all stats in the context of the listener (which I don't think we want to do), I don't think it makes sense to create the entire tree for the listener. I would just do 2xx/3xx/4xx/5xx and make sure it is under the http.{name} namespace inside the listener scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was debating about this technique. Not sure if eventually we wanted to get all of the stats for ConnectionManager. I'll scope this to 2xx/3xx/4xx/5xx and ping back when the change is in.

@ccaraman ccaraman changed the title Http Conn Man: Per Listener downstream_rq stats Http Conn Man: Per Listener downstream_rq_*xx stats Oct 2, 2017
@ccaraman
Copy link
Contributor Author

ccaraman commented Oct 2, 2017

@mattklein123 ready for review

Copy link
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

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

looks good now that the stats struct was pared down

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.

lgtm, thanks. small nit.

@@ -74,7 +74,8 @@ class HttpConnectionManagerImplTest : public Test, public ConnectionManagerConfi
POOL_TIMER(fake_stats_))},
"",
fake_stats_},
tracing_stats_{CONN_MAN_TRACING_STATS(POOL_COUNTER(fake_stats_))} {
tracing_stats_{CONN_MAN_TRACING_STATS(POOL_COUNTER(fake_stats_))},
listener_stats_{CONN_MAN_LISTENER_STATS(POOL_COUNTER_PREFIX(fake_stats_, "http.fake."))} {
Copy link
Member

Choose a reason for hiding this comment

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

nit: for consistency I would make this use the same prefix as above which is "".

Copy link
Contributor Author

@ccaraman ccaraman Oct 2, 2017

Choose a reason for hiding this comment

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

Won't fix. If I were to do that, the Http Conn Man stats and the per listener stats would be under the same scope and the values for rq_*xx will double. I think this would make the tests confusing.

I can change the prefix in the constructor to be listener._.http.fake.

Copy link
Member

Choose a reason for hiding this comment

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

What you should do is actually make a new scope with some prefix in it, instead of passing the same raw stats object. (Or pass a different isolated store).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passed a different isolated store.

@mattklein123
Copy link
Member

Oh also I think this should have docs somewhere also. (With the existing HTTP conn man stats docs).

htuch
htuch previously approved these changes Oct 3, 2017
@ccaraman ccaraman merged commit 58c3224 into master Oct 3, 2017
@ccaraman ccaraman deleted the listener_stats branch October 3, 2017 18:31
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