I need help with the usage of Perfromance Monitor, but the code that I tried to go with did not work. I ended up with this Sysmon( System Monitor ) and added it in a Windows Form Application. I need to learn how to track performance. Does anyone know how to use Perfromance Monitor or System Monitor? MSDN dosent help as their code dosent even work, my Visual Studio is complaining that the category is invalid and bla bla. Im using Windows Server 2008 R2 and VS2010.

I am totally new to this, so I realy need some good tutorial or any help.

Thanks.

You need to use WMI.

Okej so I got this working, I have implemented a System Monitor control to my windows form. And a catalog with diffrent PerformanceCounterTypes. I followed this guide:

http://www.codeproject.com/Articles/8590/An-Introduction-To-Performance-Counters

But I can't figure out how the types works. And how do I get a avarage time?
I have a thread that sleeps for a random milliseconds between 500 and 5000 mili.
And a stopwatch to calculate the time taken... ish...

Anybody out there that is a pro in this subject?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.