Skip to content

Add remarks for EventCounter APIs #3278

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

Open
mairaw opened this issue Feb 6, 2018 · 0 comments
Open

Add remarks for EventCounter APIs #3278

mairaw opened this issue Feb 6, 2018 · 0 comments
Labels
area-System.Diagnostics.Tracing doc-enhancement Improve the current content Pri2 Indicates issues/PRs that are medium priority Pri3 Indicates issues/PRs that are low priority
Milestone

Comments

@mairaw
Copy link
Contributor

mairaw commented Feb 6, 2018

Vance's comment for the F-level API docs:
dotnet/docs#3262 (comment)

There is a tutorial here

https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.Tracing/documentation/EventCounterTutorial.md

Which gives a quick example. (There are only two APIs the constructor and WriteMetric API). The EventCounter functionality is meant to be an extension of EventSource logging.

The goal of EventSource is logging. The idea is that to create new logging messages, you create a subclass System.Diagnostics.Tracing.EventSource, and you define methods for each distinct kind of message that you wish to log. . You declare arguments to this method to allow the instrumentation point to pass any information you wish to log

The bodies of these subclass methods then call 'WriteEvent' which pass the information long to whoever subscribes to your EventSource.

EventCounters allow you to instead of logging on every event, you simply gather aggregations on every event (computing just the count, sum, min, max and variance). It is these AGREGATES that then get logged (and the subscriber has control over how often the aggregates get sent). This allows even very high frequency events to be monitored cheaply.

The recommendation (which the tutorial illustrates), is to have the EventSource method call both the WriteEvent and WriteMetric API. The subscriber can then decide which of them (or both) to turn on at runtime, allowing the subscriber to have either low overhead or high detail logging.

In the short term, you can simply point at the tutorial in the remarks, but it would not hurt to have a short summary along the lines of the above for the class that you can refer to in both the constructor and WriteMetric methods.

@mairaw mairaw transferred this issue from dotnet/docs Oct 2, 2019
@dotnet-bot dotnet-bot added the untriaged New issue has not been triaged by the area owner label Oct 2, 2019
@mairaw mairaw added doc-enhancement Improve the current content Pri2 Indicates issues/PRs that are medium priority and removed untriaged New issue has not been triaged by the area owner labels Oct 2, 2019
@mairaw mairaw added this to the Backlog milestone Oct 2, 2019
@PRMerger13 PRMerger13 added the Pri3 Indicates issues/PRs that are low priority label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Diagnostics.Tracing doc-enhancement Improve the current content Pri2 Indicates issues/PRs that are medium priority Pri3 Indicates issues/PRs that are low priority
Projects
None yet
Development

No branches or pull requests

4 participants