-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat(s2n-quic-dc): implement connection-level counter aggregation #2397
Conversation
@@ -419,3 +410,13 @@ struct DcStateChanged { | |||
#[nominal_counter("state")] | |||
state: DcState, | |||
} | |||
|
|||
// NOTE - This event MUST come last, since connection-level aggregation depends 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.
You mean last in this file? (Asking since you moved it in the file..)
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.
Based on s2n-quic-events changes I don't think order matters so approving, but maybe worth fixing up the comment.
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.
yeah last in this file. basically i didn't want to have scan everything twice - once to look for all the counters, then to process the connection close.
|
||
if units == "Duration" { | ||
on_connection_closed.extend(quote!( | ||
self.measure(#info, #id, core::time::Duration::from_micros(context.#ctx_name #counter_load)); |
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.
Hm, I guess I missed before that we have u64 granularity of microseconds in our metrics. Maybe we should switch to nanoseconds? Anyway, not important for this PR.
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.
Yeah we do currently:
self.as_micros() as _ |
The tricky bit is our timestamps aren't more granular than that either, so it would be a bit of a change:
let micros = duration.as_micros() as u64; |
Description of changes:
This change implements connection-level counter aggregation. This allows aggregating counters at the connection level and then aggregating them as metrics, as opposed to them being pure counters or measurements, which don't have enough granularity to give insight into distribution of connection behaviors. For example, this change allows getting a distribution of the number of bytes sent and received on streams.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.