Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitor .NET Threads

Is there any way to monitor/log thread interactions in the .NET runtime much like VisualVM does for Java? I don't have a specific need at the moment but I think it would be nice to see how all the threads in my application interact.

https://visualvm.dev.java.net/images/threads.png

like image 689
Nick Avatar asked Dec 03 '08 21:12

Nick


2 Answers

I am unfamiliar with VisualVM in Java....but....

If you are trying to accomplish this programmatically...check out the WMI Performance Counters. I am currently working with them myself!

MSDN Link to WMI Performance Counters

Remember If you are trying see the performance counters, use the server explorer in Visual Studio .NET. You can see all of the performance counters on your machine (or a given machine), and their related properties.

For performance Counter Value retrieval, check out this link: MSDN link for Counter Value Retrieval

For a walkthrough on Changing and Retrieving Performance Counter Values, check out this link: MSDN link for Changing/Retrieving Performance Counter Values

If you're not trying to do this programmatically, and if you simply want to view the Windows Performance Monitor tool (Perfmon), you must invoke it from the Administrative Tools menu of the Control Panel (Under Performance)....OR....To open PerfMon, just go to the Start Menu, choose Run and type perfmon.

This is a great tool for visually monitoring threads and processes. This is not done programatically though, and is more for administration and viewing purposes, rather than building the information/tools for a .NET application to use/retrieve. The Perfmon tool is almost identical to the screenshot/image of the VisualVM tool in your post.

Here is a link to Windows Perfmon: The Top Ten Counters:

Perfmon Link

Hopefully this can help put you in the right direction...cheers!

like image 61
D3vtr0n Avatar answered Sep 20 '22 06:09

D3vtr0n


The .NET Diagnostics C# Thread Monitoring Application appears to do what you need.

Edit: If you're new to C#, there's a neat wiki you may want to check out specifically for Java Developers.

like image 43
George Stocker Avatar answered Sep 19 '22 06:09

George Stocker