Skip to content
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

Merged
merged 28 commits into from
Aug 7, 2020

Conversation

IEvangelist
Copy link
Member

@IEvangelist IEvangelist commented Jul 22, 2020

Summary

  • Add EventCounters overview article
  • Add EventCounters tutorial article
  • Add corresponding images
  • Add new articles to TOC

Fixes #17027

Preview

✔️ EventCounters in .NET Core
✔️ Measure event frequency with EventCounters

@IEvangelist IEvangelist self-assigned this Jul 22, 2020
@dotnet-bot dotnet-bot added this to the July 2020 milestone Jul 22, 2020
@IEvangelist IEvangelist marked this pull request as ready for review July 23, 2020 19:20
@IEvangelist IEvangelist requested review from sdmaclea and a team as code owners July 23, 2020 19:20
@IEvangelist IEvangelist requested a review from noahfalk July 23, 2020 19:25
@IEvangelist
Copy link
Member Author

IEvangelist commented Jul 23, 2020

Hey, @noahfalk I'd love your thoughts on these - based on your #17027 (comment).

@IEvangelist IEvangelist changed the title Event counters Introduce EventCounters overview article and tutorial doc Jul 23, 2020
Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

A few nits

docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
Copy link
Member

@Youssef1313 Youssef1313 left a 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.

@noahfalk
Copy link
Member

Thanks @IEvangelist : ) I've got a few other reviews already queued up, but now this one is in the list too

Copy link
Contributor

@tdykstra tdykstra left a 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.

docs/core/toc.yml Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
Copy link
Member

@noahfalk noahfalk left a 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 : )

docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
@sdmaclea
Copy link
Contributor

/cc @josalem

docs/core/toc.yml Outdated Show resolved Hide resolved
docs/core/toc.yml Outdated Show resolved Hide resolved
@IEvangelist IEvangelist marked this pull request as draft August 4, 2020 20:25
@BillWagner BillWagner modified the milestones: July 2020, August 2020 Aug 5, 2020
@IEvangelist IEvangelist marked this pull request as ready for review August 6, 2020 14:48
Copy link
Contributor

@tdykstra tdykstra left a 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.
Copy link
Contributor

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?

Copy link
Member Author

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

docs/core/diagnostics/includes/available-counters.md Outdated Show resolved Hide resolved

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
Copy link
Contributor

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)?

Copy link
Member Author

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.

docs/core/diagnostics/includes/available-counters.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Outdated Show resolved Hide resolved
docs/core/diagnostics/event-counter-perf.md Show resolved Hide resolved
docs/core/toc.yml Outdated Show resolved Hide resolved
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.

document the replacement of the PerformanceCounter and how to use it.
8 participants