4

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

5
  • Not sure if this is useful, but could give it a try; msdn.microsoft.com/en-us/library/2fh4x1xb%28vs.71%29.aspx Commented Feb 25, 2014 at 19:25
  • It's performance counters - you should be quite easily able to get the overall IO rate (which is disk + net + driver IO). I don't have the route for getting it split out into the different categories - I would hazard a guess that the same method as is used in process explorer, and so is at least a bit of effort. Commented Feb 25, 2014 at 19:47
  • Although reading a bit more, it's most likely Windows Performance Analyzer (WPA) using EVENT_TRACE_FLAG_DISK_IO and EVENT_TRACE_FLAG_DISK_FILE_IO and mapping back the IssuingThreadId to the process that requested it. Commented Feb 25, 2014 at 19:55
  • @Petesh I can single out the disk IO rates. what i'm having trouble is in getting those data rates per system process. I'm also looking into WPA as well thanks for that... Commented Feb 26, 2014 at 9:03
  • @MartijnHols Thank you very much for that... But still the data is and overall read of the disk.. Commented Feb 26, 2014 at 9:08

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you soo much i was able to extract some data through WPA. I finished a windows only solution couple months back i'm trying to make the solution more cross-platform. I will try and use this method on it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.