Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@sywhang
Copy link

@sywhang sywhang commented Apr 18, 2019

Exposing the new EventCounter variant APIs in reference assembly.

API review: https://github.com/dotnet/corefx/issues/36129

public void Increment(double increment = 1) { }
public TimeSpan DisplayRateTimeScale { get { throw null; } set { } }
}
public partial class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter
Copy link
Member

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}.

Copy link
Author

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 { } }
Copy link
Member

Choose a reason for hiding this comment

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

What about tests?

Copy link
Author

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.

@sywhang
Copy link
Author

sywhang commented Apr 19, 2019

I'm splitting the implementation of EventCounter in the ref assembly because of #36873.

@sywhang sywhang merged commit c150a14 into dotnet:master Apr 19, 2019
@jkotas
Copy link
Member

jkotas commented Apr 19, 2019

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.

@jkotas
Copy link
Member

jkotas commented Apr 19, 2019

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.

@ahsonkhan
Copy link

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. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants