-
Notifications
You must be signed in to change notification settings - Fork 1k
Enhance open connection metrics #8124
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,8 @@ pub struct StreamerStats { | |
| pub(crate) connection_rate_limiter_length: AtomicUsize, | ||
| // All connections in various states such as Incoming, Connecting, Connection | ||
| pub(crate) open_connections: AtomicUsize, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we axe open_connections ? it gets updated differently and can be very confusing. If someone ever needs the sum, they can trivially add the two in SQL in metrics.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do in a follow up PR
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexpyattaev, I reviewed the code again. I think there is a value of having open_connections which can track all open connections in various state -- even the connections which did not make into the connection table yet like those spawn into the async tasks before they were allowed into the connection table. This can help understand the worst case connection load in the system. |
||
| pub(crate) open_staked_connections: AtomicUsize, | ||
| pub(crate) open_unstaked_connections: AtomicUsize, | ||
| pub(crate) refused_connections_too_many_open_connections: AtomicUsize, | ||
| pub(crate) outstanding_incoming_connection_attempts: AtomicUsize, | ||
| pub(crate) total_incoming_connection_attempts: AtomicUsize, | ||
|
|
@@ -566,6 +568,16 @@ impl StreamerStats { | |
| self.open_connections.load(Ordering::Relaxed), | ||
| i64 | ||
| ), | ||
| ( | ||
| "open_staked_connections", | ||
| self.open_staked_connections.load(Ordering::Relaxed), | ||
| i64 | ||
| ), | ||
| ( | ||
| "open_unstaked_connections", | ||
| self.open_unstaked_connections.load(Ordering::Relaxed), | ||
| i64 | ||
| ), | ||
| ( | ||
| "refused_connections_too_many_open_connections", | ||
| self.refused_connections_too_many_open_connections | ||
|
|
||
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.
For the readability, I personally would prefer enum with Staked/Unstaked. More like an opinion, not really insisting on it.
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.
Will do in a follow up PR