Asked by:
Why are WMI counter values like AvgDiskReadQueueLength integers instead of real numbers?
Question

Hello everyone, not sure which forum to post this into but does anybody know where I can find a GOOD explanation of how to read/interpret WMI counter data? I am using a script to retrieve from WMI the values for several objects and counters, and some of the values I get back make no sense at all, especially the disk ones. For example:
Physical Disk
=============
AvgDiskReadQueueLength: 37092584869000
AvgDiskWriteQueueLength: 4655724278000
DiskReadBytesPersec: 19185557504
DiskWriteBytesPersec: 14854675968
PercentDiskReadTime: 37092584869000
PercentDiskWriteTime: 4655724278000
My questions abound!
1. What do any of those numbers mean? What unit are they measuring? It would seem the first two measure the number of disk read/write actions, the next two are in bytes, and the last two are....second? milliseconds? With the values returned being so astronomical it's hard to even guess what they could be.
2. How do I convert those numbers into something that means something? For example, some of the web postings I've seen related to AvgDiskReadQueueLength indicate that values over 1 or 2 are a bad sign. Well, in that case, I guess my machine is near death at 37092584869000. But then at the same time if I open up Performance Monitor and start graphing AvgDiskReadQueueLength, it gives me values like .0010, .0008, .0015, etc. How do I equate those values to a number like 37092584869000?
3. All those numbers do nothing but go up....so at one point, 37092584869000 was my AvgDiskReadQueueLength, but right now it's 37092589010000....just going up and up. So to find out how bad things were between my two readings, do I need to subtract one from the other and divide by some magic number and then take the inverse reciprocal of the square root? It feels about that opaque to me, right now.
Any help is GREATLY appreciated!!!
TedWednesday, April 13, 2011 7:17 PM
All replies

Ted, after doing some investigating it seems that in order to find out how to get a "cooked" value from the raw value, you have to jump through these hoops (and let's use AvgDiskWriteQueueLength as an example):
1. Find a website where the parameter you are working with is listed. For our example, this website will work:
http://msdn.microsoft.com/enus/library/aa394308(v=VS.85).aspx
2. From that website get the counter type...here's what you get for our example:
AvgDiskWriteQueueLength
Data type: uint64
Access type: Readonly
Qualifiers: CounterType (5571840)
3. Translate that counter type name into what looks like a completely random numerical value (in this example it's 5571840)
4. Go to yet a different website to find out what Cooking Type the numerical Counter Type is. That website is: http://msdn.microsoft.com/enus/library/aa389383.aspx
and for our example, it's a type of PERF_COUNTER_100NS_QUEUELEN_TYPE
5. Go to yet another different website and look for the Cooking Type (under a heading that says Counter Typesso that's intuitive). http://technet.microsoft.com/enus/library/cc785636(WS.10).aspx6. Find and click on the "type" (from step #4) in the left side pane
7. Then you'll see the formula....but then you have to decipher what the formula means. In the example, the formula is (TB(X1X0)) / (Y1Y0), but then you have to read and try to understand what it means when it then says "....where TB represents the performance frequency time base, the denominator (Y) represents the performance time measurement, and the numerator (X) represents counter data." Wow, whoever wrote that must work in the federal government!
Hope that helps you.....and anyone else out there!
Wednesday, April 27, 2011 2:09 PM 
Great post, helps a lots to get the right formulas.
But doesn't say much about which values from WMI to actually use in the formulas, or maybe I'm just stupid?
How to know what the right denominator or numerator is?
Some examples on TechNet would be lovely...
Thank you,
Jesper
Friday, July 1, 2011 9:10 AM