在Windows上以编程方式获取每进程磁盘io统计信息? [英] Programmatically getting per-process disk io statistics on Windows?
问题描述
我想显示一个进程列表(Windows,C ++),以及以KB /秒为单位从磁盘读取和写入的数量。
I would like to display a list of processes (Windows, C++) and how much they are reading and writing from the disk in KB/sec.
Windows 7的监视器有能力,所以我应该能够做同样的。
The Resource Monitor of Windows 7 has the ability so I should be able to do the same.
但是我无法找到相关的API调用或在perfmon计数器中找到任何东西。
However I have unable to find a relevant API-call or find anything in the perfmon counters. Could anyone point me in the direction?
推荐答案
您可以致电 GetProcessIoCounters 以获取每个进程的总磁盘I / O数据 - 您需要跟踪增量并转换为基于时间的速率
You can call GetProcessIoCounters to get overall disk I/O data per process - you'll need to keep track of deltas and converting to time-based rate yourself.
此API将告诉您I / O操作的总数以及总字节数。
This API will tell you total number of I/O operations as well as total bytes.
这篇关于在Windows上以编程方式获取每进程磁盘io统计信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!