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

Commit eae74b8

Browse files
sywhangjkotas
authored andcommitted
Add runtime counter for TP work items produced (#24618)
1 parent 782585e commit eae74b8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ internal sealed class RuntimeEventSource : EventSource
2323
private PollingCounter? _threadPoolThreadCounter;
2424
private IncrementingPollingCounter? _monitorContentionCounter;
2525
private PollingCounter? _threadPoolQueueCounter;
26+
private IncrementingPollingCounter? _completedItemsCounter;
2627

2728
private const int EnabledPollingIntervalMilliseconds = 1000; // 1 second
2829

@@ -54,6 +55,7 @@ protected override void OnEventCommand(EventCommandEventArgs command)
5455
_threadPoolThreadCounter = _threadPoolThreadCounter ?? new PollingCounter("threadpool-thread-count", this, () => ThreadPool.ThreadCount) { DisplayName = "ThreadPool Thread Count" };
5556
_monitorContentionCounter = _monitorContentionCounter ?? new IncrementingPollingCounter("monitor-lock-contention-count", this, () => Monitor.LockContentionCount) { DisplayName = "Monitor Lock Contention Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
5657
_threadPoolQueueCounter = _threadPoolQueueCounter ?? new PollingCounter("threadpool-queue-length", this, () => ThreadPool.PendingWorkItemCount) { DisplayName = "ThreadPool Queue Length" };
58+
_completedItemsCounter = _completedItemsCounter ?? new IncrementingPollingCounter("threadpool-completed-items-count", this, () => ThreadPool.CompletedWorkItemCount) { DisplayName = "ThreadPool Completed Work Item Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) };
5759
}
5860
}
5961
}

0 commit comments

Comments
 (0)