How to Get Per Process Disk Activity in Windows

匿名 (未验证) 提交于 2019-12-03 09:05:37

问题:

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

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!