-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Expose new variants of EventCounter APIs #36989
Conversation
| public void Increment(double increment = 1) { } | ||
| public TimeSpan DisplayRateTimeScale { get { throw null; } set { } } | ||
| } | ||
| public partial class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter |
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 these the type names agreed to in the API review? Looking at it here, it's strange to me that IncrementingEventCounter didn't derive from EventCounter, and the same for {IncrementingPollingCounter}.
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.
Yes, the names were agreed to during the API review meeting.
EventCounter now derives from a base class DiagnosticCounter, and all these other counters do as well.
| public partial class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter | ||
| { | ||
| public IncrementingPollingCounter(string name, System.Diagnostics.Tracing.EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource) { } | ||
| public TimeSpan DisplayRateTimeScale { get { throw null; } set { } } |
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.
What about tests?
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.
There are some tests that are checked in CoreCLR: https://github.com/dotnet/coreclr/tree/master/tests/src/tracing/eventcounter. I've tested these end-to-end scenarios using dotnet-counters (https://github.com/dotnet/diagnostics/tree/master/src/Tools/dotnet-counters), but I'll be checking in smaller tests to CoreCLR soon.
…ted through the targetingpack
|
I'm splitting the implementation of EventCounter in the ref assembly because of #36873. |
@sywhang It is better to just add ApiCompatBaseline like this: https://github.com/dotnet/corefx/blob/master/src/System.Runtime/src/ApiCompatBaseline.uapaot.txt . It is what we do to workaround the synchronization delay with .NET Native. |
|
Also, please "squash and merge" next time and use appropriate commit descriptions. Your "I'm stupid" commit description is recorded in the git history forever now. |
|
Yes, please (squash and merge). I just saw this in the git log and was about to mention the same thing! As an aside, consider more meaningful commit messages as well, just in case. :) |
Exposing the new EventCounter variant APIs in reference assembly.
API review: https://github.com/dotnet/corefx/issues/36129