Microsoft KB Archive/269481

{|
 * width="100%"|

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

 * }

Q269481

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), included with:
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Datacenter Server
 * Microsoft Windows 2000 Professional
 * Microsoft Windows 2000 Server
 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0

-

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 Windows NT 4.0 to Windows 2000.

MORE INFORMATION
Windows 2000 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.

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

The calculation for PERF_COUNTER_TIMER counter type is performed as follows:


 * 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:


 * 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 Disk Counters
On Windows 2000, 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 &quot;clock&quot; 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:

The calculation for PERF_PRECISION_100NS_TIMER counter type is performed as follows:


 * 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:


 * 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.