Skip to content

http: fix upstream_rq stat increment #4055

Merged
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
ramaraochavali:fix/stats_count
Aug 7, 2018
Merged

http: fix upstream_rq stat increment #4055
mattklein123 merged 2 commits intoenvoyproxy:masterfrom
ramaraochavali:fix/stats_count

Conversation

@ramaraochavali
Copy link
Copy Markdown
Contributor

Signed-off-by: Rama rama.rao@salesforce.com
Description: Increment upstream_rq in case of connection failures also for http1.
Risk Level: Low
Testing: Added Automated tests
Docs Changes: N/A
Release Notes: N/A
Fixes #3950

Signed-off-by: Rama <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Copy Markdown
Contributor Author

@mattklein123 PTAL. Fixed upstream_rq increment incase of connection failure in http1. For http2 it seems to work correctly, so just added test validation.

@htuch htuch self-assigned this Aug 5, 2018
htuch
htuch previously approved these changes Aug 5, 2018
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Copy Markdown
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.

Thanks for working on this!

host_->stats().cx_connect_fail_.inc();

// Increment the total requests also.
host_->cluster().stats().upstream_rq_total_.inc();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be better to consolidate this logic and only increment these stats in 1 place. Can you take a look at the other place we do this and move the increment to when the connection pool is first asked for a stream?

Signed-off-by: Rama <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Copy Markdown
Contributor Author

@mattklein123 consolidated the logic. PTAL when you get a chance?


StreamEncoderWrapper::inner_.getStream().addCallbacks(*this);
parent_.parent_.host_->cluster().stats().upstream_rq_total_.inc();
parent_.parent_.host_->cluster().stats().upstream_rq_active_.inc();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Arguably rq_active should move also, though, the logic to keep that consistent will be more complicated and I'm not sure it's worth it. Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes.It may not be worth the complication.

Copy link
Copy Markdown
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.

Thanks

@mattklein123 mattklein123 merged commit e96d4a6 into envoyproxy:master Aug 7, 2018
@ramaraochavali ramaraochavali deleted the fix/stats_count branch August 8, 2018 03:59
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.

3 participants