-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Introduce EventCounters overview article and tutorial doc #19635
Conversation
Hey, @noahfalk I'd love your thoughts on these - based on your #17027 (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.
A few nits
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.
The code can be separated from the article to be part of CI build.
Thanks @IEvangelist : ) I've got a few other reviews already queued up, but now this one is in the list too |
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.
Great work on these docs! I had a few comments and suggestions.
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 @IEvangelist for your work putting these together! Hope the feedback is useful : )
052d6da
to
c2de932
Compare
/cc @josalem |
docs/core/diagnostics/snippets/EventCounters/ConditionalEventCounterSource.cs
Show resolved
Hide resolved
Co-authored-by: Noah Falk <[email protected]>
a4a4415
to
d8f791d
Compare
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.
Much improved, still some rough edges here and there but it's looking good!
|
||
The .NET Core runtime and a few .NET libraries publish basic diagnostics information using EventCounters starting in .NET Core 3.0. Apart from the EventCounters that are provided by the .NET runtime, you may choose to implement your own EventCounters. EventCounters can be used to track various metrics. | ||
|
||
EventCounters live as a part of an <xref:System.Diagnostics.Tracing.EventSource>, and are automatically pushed to listener tools on a regular basis. Like all other events on an <xref:System.Diagnostics.Tracing.EventSource>, they can be consumed both in-proc and out-of-proc via <xref:System.Diagnostics.Tracing.EventListener> and EventPipe. This article focuses on the cross-platform capabilities of EventCounters, and intentionally excludes PerfView and ETW (Event Tracing for Windows) - although both can be used with EventCounters. |
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.
Is there an intro to EventPipe that we can link to?
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 this issue, I'm assuming we should write a new article for it: dotnet/diagnostics#1183. As there isn't anything to link to yet. EventPipe would then link back to EventSource.
EventCounter <-> EventSource <-> EventPipe
|
||
Throughout various .NET packages, basic metrics on GC, Just-in-Time (JIT), assemblies, exceptions, threading, networking, and web requests are published using EventCounters. | ||
|
||
### "System.Runtime" counters |
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.
Are quotation marks necessary here (and in the other headings that have them)?
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.
I choose to use them, as they are the name in which to directly access the counters. And they vary ever so slightly, notice the naming conventions inconsistently use .
vs -
delimiters.
Co-authored-by: Tom Dykstra <[email protected]>
Summary
Fixes #17027
Preview
✔️ EventCounters in .NET Core
✔️ Measure event frequency with EventCounters