Programmatically Getting Per-Process Disk Io Statistics on Windows

Programmatically getting per-process disk io statistics on Windows?

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.

This API will tell you total number of I/O operations as well as total bytes.

How to Get Per Process Disk Activity in Windows

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.

Programmatically getting per-process network statistics on Windows?

I wrote a solution to this.

A TDI filter driver to collect the stats, a service which communicates with the driver and gets the stats once per second. Since the filter is at the TDI layer, I know which sockets belong to which applications. The service is a server for this data, offering it via shared memory to arbitrary third party clients via an API I wrote. I wrote a GUI and a command line client.

You can also bandwidth shape sends (per interface and/or application and/or socket) and watch data passing over a socket in real time, in a window.

Per Process disk read/write statistics in Mac OS X

Use iotop (as root), for example:

iotop -C 3 10

But the best way (for me) is:

sudo fs_usage -f filesys


Related Topics



Leave a reply



Submit