From: Sung Yoon Whang Date: Thu, 18 Apr 2019 06:16:47 +0000 (-0700) Subject: Exposing the new counter APIs in System.Diagnostics.Tracing X-Git-Tag: submit/tizen/20210909.063632~11031^2~1834 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0a2a3ae0eaaf66056c124d7f6e7db5ca10ff633;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Exposing the new counter APIs in System.Diagnostics.Tracing Commit migrated from https://github.com/dotnet/corefx/commit/c042b3aa7de95332624f3d725e8abdb4d3d043f5 --- diff --git a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs index 173b09a..6263c2c 100644 --- a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs +++ b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs @@ -53,11 +53,37 @@ namespace System.Diagnostics.Tracing public bool DisableEvent(int eventId) { throw null; } public bool EnableEvent(int eventId) { throw null; } } - public partial class EventCounter : System.IDisposable + public abstract partial class DiagnosticCounter : System.IDisposable { - public EventCounter(string name, System.Diagnostics.Tracing.EventSource eventSource) { } + public DiagnosticCounter(string name, EventSource eventSource) { } + public void AddMetadata(string key, string value) { } public void Dispose() { } + public string DisplayName { get { throw null; } set { } } + public string Name { get { throw null; } } + public EventSource EventSource { get { throw null; } } + } + + public partial class EventCounter : System.Diagnostics.Tracing.DiagnosticCounter + { + public EventCounter(string name, System.Diagnostics.Tracing.EventSource eventSource) : base(name, eventSource) { } public void WriteMetric(float value) { } + public void WriteMetric(double value) { } + + } + public partial class PollingCounter : System.Diagnostics.Tracing.DiagnosticCounter + { + public PollingCounter(string name, System.Diagnostics.Tracing.EventSource eventSource, Func metricProvider) : base(name, eventSource) { } + } + public partial class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter + { + public IncrementingEventCounter(string name, System.Diagnostics.Tracing.EventSource eventSource) : base(name, eventSource) { } + public void Increment(double increment = 1) { } + public TimeSpan DisplayRateTimeScale { get { throw null; } set { } } + } + public partial class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter + { + public IncrementingPollingCounter(string name, EventSource eventSource, Func totalValueProvider) : base(name, eventSource) { } + public TimeSpan DisplayRateTimeScale { get { throw null; } set { } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct, Inherited=false)] public partial class EventDataAttribute : System.Attribute