For a given process, how can I learn its
- cpu usage (%)
- memory usage (allocated memory)
- network usage (bytes in/sec, bytes out/sec)
I'm interested in collecting this information from a c# app.
For a given process, how can I learn its
I'm interested in collecting this information from a c# app.
It is possible to track all that information with the PerformanceCounter Class.
You can find a more detailed list here as to what kind of information you can track.
This article and this example + some c# coding skills are all you need.
Oh, and concerning the process network monitoring, Microsof has a Network Monitor API but YAPM is a superman.
There are classes built into C# that can do this. A Simple Google search "calculate memory usage C#" of "calculate cpu usage C#" brought them up
http://bhaskarrajukonduru-dotnet.blogspot.ca/2010/06/calculate-memory-and-cpu-usage-by-using.html http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-in-c (note, you could of searched stackoverflow too) http://www.codeproject.com/Articles/10258/How-to-get-CPU-usage-of-processes-and-threads