From 37ff0f54f4259e2e9629c62dfc7602c37ee3a97a Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Sat, 15 Jun 2019 16:46:02 -0700 Subject: [PATCH] Add active timer counter (#25186) * Add active timer counter * fix typo --- .../src/System/Diagnostics/Eventing/RuntimeEventSource.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs index 2011101..1e75d0e 100644 --- a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs +++ b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs @@ -31,6 +31,7 @@ namespace System.Diagnostics.Tracing private PollingCounter? _lohSizeCounter; private IncrementingPollingCounter? _allocRateCounter; private PollingCounter? _assemblyCounter; + private PollingCounter? _timerCounter; private const int EnabledPollingIntervalMilliseconds = 1000; // 1 second @@ -70,6 +71,7 @@ namespace System.Diagnostics.Tracing _lohSizeCounter = _lohSizeCounter ?? new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size" }; _allocRateCounter = _allocRateCounter ?? new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; _assemblyCounter = _assemblyCounter ?? new PollingCounter("assembly-count", this, () => System.Reflection.Assembly.GetAssemblyCount()) { DisplayName = "Number of Assemblies Loaded" }; + _timerCounter = _timerCounter ?? new PollingCounter("active-timer-count", this, () => Timer.ActiveCount) { DisplayName = "Number of Active Timers" }; } } } -- 2.7.4