I need to extract disk statistics for a given process, I can get the processes listed and get overall information such as CPU and Memory listed using WMI and PerformanceCounters. But the information is all bundled up, is there any way to extract those data per process. Kind of like in Windows Resource Monitor?
Thanks in Advance
If you need live data, you should implement ETW listener.
ETW are the way of tracing performance information in Windows. It is supported back to Windows 2000.
Every component in Windows report ETW events (if there is a listener waiting for data).
For example, Disk info, memory (consumption, page faults, etc..), contention, CPU usage (per core, per thread, per application, even single IO requests to the disk or the network. Drivers uses it, .NET CLR uses it (get JIT or GC stats), and the examples are endless.
I suggest you will start with downloading XPerf\Xperf view, or Windows Performance Recorder + Analyzer, PerfView, try to see what information exactly are you looking for, and then start creating your Managed ETW listener.
You can start with this blog post, or search for ETW posts by Vans Morison (which is in charge of the Managed ETW Providers and Consumers in MS).
Hope this helps, Ofir.