I dislike the old perfmon interface and it's unreadable graphs and logs. For a long time I've been searching for a basic vmstat and/or iostat windows port, and one that doesn't rely on that nonsensical cygwin. If anybody knows of one, please leave a comment.
Here's a proof on concept I cooked up in 20 minutes using the PDH (performance data helper) functions. In a nutshell, it queries the PDH counters directly and I'm be free to display
the data however I like.
Here's what I got so far:
proc_q_len pagefile interrupt/s cswitch/s %cpu_user %cpu_sys %cpu_idle %disk_busy %disk_read %disk_write
10 2308780032 2016 2555 64 26 9 100 0 100
3 2308911104 2863 3669 62 13 23 100 1 100
0 2309206016 1857 3057 79 10 9 2 0 2
0 2310217728 2579 3664 64 9 26 100 0 100
1 2309140480 2195 2985 71 3 25 100 0 100
2 2309140480 2241 3042 76 4 18 100 0 100
Not perfect, and I'm still trying to devise a proper layout for the stuff I want to display.
The columns shown correspond to the counters:
- \System\Processor Queue Length
- \Process(_Total)\Page File Bytes
- \Processor(_Total)\Interrupts/sec
- \System\Context Switches/sec
- \Processor(_Total)\% User Time
- \Processor(_Total)\% Privileged Time
- \Processor(_Total)\% Idle Time
- \PhysicalDisk(_Total)\% Disk Time
- \PhysicalDisk(_Total)\% Disk Read Time
- \PhysicalDisk(_Total)\% Disk Write Time
The general flow of code is like this (there are samples online):
1. PdhOpenQuery
2. PdhAddCounter for each counter
3. for each X seconds:
3.2 PdhGetFormattedCounterValue for each counter
3.3 print the result for each counter