如何在Windows中获取每个进程的磁盘活动 [英] How to Get Per Process Disk Activity in Windows

查看:294
本文介绍了如何在Windows中获取每个进程的磁盘活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要提取给定进程的磁盘统计信息,我可以使用WMI和PerformanceCounters获得列出的进程并获得诸如列出的CPU和内存之类的总体信息.但是信息都是捆绑在一起的,是否有任何方法可以在每个过程中提取这些数据.在Windows资源监视器中有点像?

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?

预先感谢

推荐答案

如果需要实时数据,则应实现ETW侦听器.

If you need live data, you should implement ETW listener.

ETW是在Windows中跟踪性能信息的方法.回到Windows 2000都受支持.

ETW are the way of tracing performance information in Windows. It is supported back to Windows 2000.

Windows中的每个组件都会报告ETW事件(如果有一个侦听器正在等待数据).

Every component in Windows report ETW events (if there is a listener waiting for data).

例如,磁盘信息,内存(消耗量,页面错误等),争用,CPU使用率(每个内核,每个线程,每个应用程序,甚至单个IO请求到磁盘或网络). 驱动程序使用它,.NET CLR使用它(获取JIT或GC统计信息),示例无穷无尽.

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.

我建议您首先下载XPerf \ Xperf视图或Windows Performance Recorder + Analyzer,PerfView,然后尝试查看所需的信息,然后开始创建托管的ETW侦听器.

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.

您可以从博客帖子,或搜索Vans Morison(负责MS的ETW受管提供者和消费者)的ETW帖子.

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.

这篇关于如何在Windows中获取每个进程的磁盘活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆