-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Skip counter measurement when start listening while processing #48045
Conversation
@halter73 Addresses your comment here: #47758 (review)
|
I think the goal here is to make each operation either report metrics or not report metrics for its entire duration, is that right? |
src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelMetrics.cs
Outdated
Show resolved
Hide resolved
ab00e05
to
7bd1a95
Compare
SignalR done. |
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.
Thanks! This seems much less prone to user error.
src/Servers/Kestrel/Core/src/Internal/Infrastructure/ConnectionMetricsContext.cs
Show resolved
Hide resolved
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Someone could start listening to counters after something we want to measure (e.g. a connection) has started. This is a problem for some counters:
Hosting already worked. It calculates counters being enabled when a connection starts.
Kestrel needed a lot of work. This PR adds a metric context that figures out what counters are enabled when a connection starts and uses those values for the life of the connection.
It's tough to flow a metrics context throughout a connection. This PR uses an internal feature that Kestrel always sets.