.NET › Diagnostics & Performance
How does dotnet-counters provide live performance monitoring, and what key metrics does it expose by default?
IntermediateAnswer
dotnet-counters connects to a running .NET process and streams live performance counters to the console (or exports them), including built-in metrics like CPU usage, GC heap size and collection counts per generation, ThreadPool thread count and queue length, exception count, and (for ASP.NET Core apps) request rate and active request count -- giving a real-time operational view without needing a full profiling session.
dotnet-counters monitor --process-id 1234
# Live output includes:
# cpu-usage, gc-heap-size, gen-0-gc-count, threadpool-thread-count, request-rate...Real-world example An engineer investigating intermittent slow responses runs dotnet-counters live during a suspected incident window, immediately spotting an unusual spike in ThreadPool queue length correlating with the reported slowness.