Skip to content

Commit

Permalink
Dump the available information for CLR's thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
odinserj committed Nov 29, 2023
1 parent c7f0c8f commit abb03ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/stdump/DumpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ public static void WriteDump(DataTarget target, TextWriter writer, CancellationT

var runtime = clrVersion.CreateRuntime();

if (runtime.ThreadPool != null)
{
writer.WriteLine("Following ThreadPool information found:");
writer.WriteLine($" CPU Utilization by ThreadPool: {runtime.ThreadPool.CpuUtilization}%");
writer.WriteLine($" Worker threads: Active {runtime.ThreadPool.ActiveWorkerThreads}, Idle {runtime.ThreadPool.IdleWorkerThreads}, Min {runtime.ThreadPool.MinThreads}, Max {runtime.ThreadPool.MaxThreads}");
writer.WriteLine($" Completion ports: Free {runtime.ThreadPool.FreeCompletionPorts}, Total {runtime.ThreadPool.TotalCompletionPorts}, Min {runtime.ThreadPool.MinCompletionPorts}, Max {runtime.ThreadPool.MaxCompletionPorts}");
string type = null;
if (runtime.ThreadPool.UsingPortableThreadPool) type = "Portable";
if (runtime.ThreadPool.UsingWindowsThreadPool) type = "Windows";
writer.WriteLine($" Type: {type}");
}
else
{
writer.WriteLine("No ThreadPool information found.");
}

writer.WriteLine();

writer.WriteLine("Following AppDomains found:");
writer.WriteLine();

Expand Down

0 comments on commit abb03ee

Please sign in to comment.