question

Ritesh S. avatar image
Ritesh S. asked ·

How to get the total thread count in .NET (not just active threads)

Hi,

I have a query, we are able to monitor the .NET Thread count , which is

The number of threads currently active in this .NET process

However, if we want to know the total number of threads available in the pool, through dynaTrace how do we achieve it ? It is usually part of the perf mon statistics but unable to get it as it does not show up as a parameter that can be charted.

Thanks and Regards,

Ritesh.

10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Answer

Andreas G. avatar image
Andreas G. answered ·

Hi Ritesh

There is already an out-of-the-box measure "Total .NET Threads" that the Agents delivers. If that is not what you want I can see additional Thread-related Performance Counters for .NET such as "# of current logical Threads", "#of current phyiscal Threads", ...
You can find all measures available by using the Performance Monitor tool that comes with windows. Just look under the category ".NET CLR LocksAndThreads". If you want these additional metrics you can Create new Agent Based measures of type "Custom Windows Performance Counter".
The only thing you need to fill out is the the three Measure Specific Fields: Performance Object, Performance Counter, Instance. Here is an example for these values for one of the measures I referenced above:
Performance Object: .NET CLR LocksAndThreads
Performance Counter: # of current physical Threads
Instance: {monitored_process}

There is more on this in the online help: Windows Performance Monitor

Andi

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.