INFO: Changes to LogicalDisk and PhysicalDisk Precision Counter Types for Windows

Article translations Article translations
Article ID: 269481 - View products that this article applies to.
This article was previously published under Q269481
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SUMMARY

An application can use either the Performance Data Helper (PDH) functions or the RegQueryValueEx function with HKEY_PERFORMANCE_DATA to collect performance data information of any performance object. This article explains the LogicalDisk and PhysicalDisk counter types that changed from Microsoft Windows NT 4.0 to Microsoft Windows 2000 and Microsoft WIndows XP.

MORE INFORMATION

Windows 2000 and Windows XP added a new counter, % Idle Time, to both logical and physical disks. It also changed the type of some counter data. The remainder of this article discusses the disk counters on Windows NT 4.0 and on Windows 2000 and Windows XP.

Windows NT 4.0 Disk Counters

On Windows NT 4.0, the LogicalDisk and PhysicalDisk performance objects have the following counter definitions:

Collapse this tableExpand this table
Counter NameCounter IndexCounter Type
% Disk Time200PERF_COUNTER_TIMER
% Disk Read Time202PERF_COUNTER_TIMER
% Disk Write Time204PERF_COUNTER_TIMER
Avg. Disk Queue Length1400PERF_COUNTER_LARGE_QUEUELEN_TYPE
Avg. Disk Read Queue Length1402PERF_COUNTER_LARGE_QUEUELEN_TYPE
Avg. Disk Write Queue Length1404PERF_COUNTER_LARGE_QUEUELEN_TYPE

The calculation for PERF_COUNTER_TIMER counter type is performed as follows:

Collapse this tableExpand this table
ElementValue
XCounterData
YPerfTime from PERF_DATA_BLOCK
Time basePerfFreq
Data Size8 Bytes
Display Suffix%
Calculation100*(X1-X0)/(Y1-Y0)
  • X0 = counter value from first measurement.
  • X1 = counter value from second measurement.
  • Y0 = time from the PERF_DATA_BLOCK.PerfTime member for the first measurement.
  • Y1 = time from the PERF_DATA_BLOCK.PerfTime member for the second measurement.
The calculation for PERF_COUNTER_LARGE_QUEUELEN_TYPE counter type is performed as follows:

Collapse this tableExpand this table
ElementValue
XCounterData
YPerfTime from PERF_DATA_BLOCK
Time basePerfFreq
Data Size8 Bytes
Display SuffixNo suffix
Calculation(X1-X0)/(Y1-Y0)
  • X0 = counter value from first measurement.
  • X1 = counter value from second measurement.
  • Y0 = time from the PERF_DATA_BLOCK.PerfTime member for the first measurement.
  • Y1 = time from the PERF_DATA_BLOCK.PerfTime member for the second measurement.

Windows 2000 and Windows XP Disk Counters

On Windows 2000 and Windows XP, the % Time counters in LogicalDisk as well as PhysicalDisk performance objects are changed to use precision counters. Precision counters consist of two counter values:
  • The counter data of the event that is being monitored.
  • The "clock" time in the same units as the first item.This is when the measurement was made.
A precision counter consists of the performance data object and a timestamp counter immediately following it with the same counter index. Precision counters are used where the standard system timers are not precise enough for accurate readings. The performance service that is supplying the performance data provides a timestamp at the same time, which eliminates any error that is caused by small and variable lapses between the time the system timestamp is captured and when the data is collected from the performance DLL.

The LogicalDisk and PhysicalDisk performance objects have the following counter definitions on Windows 2000 and Windows XP:

Collapse this tableExpand this table
Counter NameCounter IndexCounter Type
% Disk Time200PERF_PRECISION_100NS_TIMER
% Disk Time200PERF_PRECISION_TIMESTAMP
% Disk Read Time202PERF_PRECISION_100NS_TIMER
% Disk Read Time202PERF_PRECISION_TIMESTAMP
% Disk Write Time204PERF_PRECISION_100NS_TIMER
% Disk Write Time204PERF_PRECISION_TIMESTAMP
% Idle Time1482PERF_PRECISION_100NS_TIMER
% Idle Time1482PERF_PRECISION_TIMESTAMP
Avg. Disk Queue Length1400PERF_COUNTER_100NS_QUEUELEN_TYPE
Avg. Disk Read Queue Length1402PERF_COUNTER_100NS_QUEUELEN_TYPE
Avg. Disk Write Queue Length1404PERF_COUNTER_100NS_QUEUELEN_TYPE

The calculation for PERF_PRECISION_100NS_TIMER counter type is performed as follows:

Collapse this tableExpand this table
ElementValue
XCounterData
YN/A
Time basePerfTime100nSec from PERF_DATA_BLOCK
Data Size8 Bytes
Display Suffix%
Calculation100*(X1-X0)/(B1-B0)
  • X0 = counter value from first measurement (PERF_PRECISION_100NS_TIMER).
  • X1 = counter value from second measurement (PERF_PRECISION_100NS_TIMER).
  • B0 = time from the PERF_PRECISION_TIMESTAMP for the first measurement.
  • B1 = time from the PERF_PRECISION_TIMESTAMP for the second measurement.
For the PERF_PRECISION_100NS_TIMER counter type, the data collected is in the PERF_PRECISION_100NS_TIMER counter. The timestamp, which is stored in a PERF_PRECISION_TIMESTAMP counter, follows immediately and has the same counter index. For example, after the application has determined the counter index 200 and location of the % Disk Time counter, the precision timestamp base is the counter following it with a counter index of 200.

The calculation for PERF_COUNTER_100NS_QUEUELEN_TYPE counter type is performed as follows:

Collapse this tableExpand this table
ElementValue
XCounterData
YPerfTime100nSec from PERF_DATA_BLOCK
Time base100NS
Data Size8 Bytes
Display SuffixNo suffix
Calculation(X1-X0)/(Y1-Y0)
  • X0 = counter value from first measurement.
  • X1 = counter value from second measurement.
  • Y0 = time from the PERF_DATA_BLOCK.PerfTime member for the first measurement.
  • Y1 = time from the PERF_DATA_BLOCK.PerfTime member for the second measurement.

REFERENCES

For detailed information about how to retrieve these counter values, refer to the Performance Monitoring topic in Microsoft Platform SDK or the Microsoft Developer Network (MSDN) documentation, under Base Services.

Properties

Article ID: 269481 - Last Review: February 28, 2014 - Revision: 4.1
APPLIES TO
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 2000 Standard Edition
    • the operating system: Microsoft Windows XP
Keywords: 
kbnosurvey kbarchive kbinfo kbkernbase kbperfmon KB269481

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com