Export (0) Print
Expand All

2.2.4.2 _PERF_COUNTER_REG_INFO

The _PERF_COUNTER_REG_INFO structure contains information on the counter and is used when enumerating performance counter information on the server.

typedef struct _PERF_COUNTER_REG_INFO {
  unsigned long CounterId;
  unsigned long Type;
  unsigned __int64 Attrib;
  unsigned long DetailLevel;
  long DefaultScale;
  unsigned long BaseCounterId;
  unsigned long PerfTimeId;
  unsigned long PerfFreqId;
  unsigned long MultiId;
  unsigned long AggregateFunc;
  unsigned long Reserved;
} PERF_COUNTER_REG_INFO, 
 *PPERF_COUNTER_REG_INFO;

CounterId: The numeric identifier of the counter. A performance counter's CounterId value MUST be unique within its counterset.

Type: The type of counter. The client MAY need to perform numeric operations on the value of the counter that is retrieved from the server in order to use it for analysis. Unless explicitly stated as an instantaneous value, the client MAY need to cache the value of the counter to compare it with the value from the next query. The value MUST be one of the following.

Value Meaning

PERF_COUNTER_COUNTER
0x10410400

The counter data is a 32-bit value that indicates the rate of events being counted per second. To get the rate, the client takes the difference between counter values from two subsequent queries and divides it by the time difference between the two query time stamps. The unit of time is system time. The value is displayed as a rate of counts per second.

PERF_COUNTER_TIMER
0x20410500

The counter data is a 64-bit value that indicates the percentage of time that the server component updating the counter data was active over the sample interval. The client takes the difference in this value between subsequent queries and divides it by the sample interval; it displays this ratio as a percentage.

PERF_COUNTER_QUEUELEN_TYPE
0x00450400

The counter data is a 32-bit value that indicates the average change in the length of a queue over the sample interval. The client takes the difference in this value between subsequent queries and divides it by the sample interval.

PERF_COUNTER_LARGE_QUEUELEN_TYPE
0x00450500

This counter is similar to PERF_COUNTER_QUEUELEN_TYPE, except that the counter data is a 64-bit value.

PERF_COUNTER_100NS_QUEUELEN_TYPE
0x00550500

This counter is similar to PERF_COUNTER_LARGE_QUEUELEN_TYPE, except that the client assumes its clock is updated at a frequency of 100 nanoseconds for this calculation.

PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE
0x00650500

The counter data is a 32-bit value that indicates the average change in the length of a queue over the sample interval. The client takes the difference in this value between subsequent queries and divides it by the time difference that the server provides through the PerfTimeId counter, which contains the time stamp, and the PerfFreqId counter, which contains the frequency at which the server updates the time.

PERF_COUNTER_BULK_COUNT
0x10410500

This counter is similar to PERF_COUNTER_COUNTER, except that the counter data is a 64-bit value.

PERF_COUNTER_TEXT
0X00000B00

This counter is not a numeric counter, but rather Unicode text. The value is displayed as text.

PERF_COUNTER_RAWCOUNT
0x00010000

The counter data is an instantaneous 32-bit value and is not divided by a sample interval to calculate the average.

PERF_COUNTER_LARGE_RAWCOUNT
0x00010100

This counter is similar to PERF_COUNTER_RAWCOUNT, except that the counter data is a 64-bit value.

PERF_COUNTER_RAWCOUNT_HEX
0x00000000

The counter data is an instantaneous 32-bit value and is not divided by a sample interval to calculate the average. The value is displayed as a hexadecimal number.

PERF_COUNTER_LARGE_RAWCOUNT_HEX
0x00000100

This counter is similar to PERF_COUNTER_RAWCOUNT_HEX, except that the counter data is a 64-bit value.

PERF_SAMPLE_FRACTION
0x20C20400

The counter data is a 32-bit value that is used with another counter to calculate a ratio that is displayed as a percentage. The client takes the difference between this counter data value and divides it by the difference between the data value queries of the BaseCounterId counter.

PERF_SAMPLE_COUNTER
0x00410400

The 32-bit counter data is similar to the PERF_COUNTER_COUNTER, except that the system performance time is used to calculate the sample interval instead of the system time.

PERF_COUNTER_TIMER_INV
0x21410500

The 64-bit counter data is generally used to show inactive time. The client takes the difference in the counter data between two queries and then divides that by the sample interval, which is calculated by using the system performance time. This ratio is then subtracted from 1 and displayed as a percentage.

PERF_ELAPSED_TIME
0x30240500

The 64-bit counter data contains a time value from which the value of the PerfTimeId counter is subtracted. This difference is then divided by the value of the PerfFreqId counter, which contains the frequency at which the server updates the time.

PERF_SAMPLE_BASE
0x40030401

The 32-bit counter data is used as the BaseCounterId for calculations that involve PERF_SAMPLE_FRACTION and MUST be greater than 0.

PERF_AVERAGE_TIMER
0x30020400

The 32-bit counter data is generally used to indicate the average time for an operation. The client takes the difference in the counter data between subsequent queries and divides that by the frequency of the system clock. It then divides this value by the value of the difference between subsequent queries of the BaseCounterId counter, which would contain the number of operations.

PERF_AVERAGE_BASE
0x40030402

The 32-bit counter data is used as the BaseCounterId counter in calculations that involve PERF_AVERAGE_TIMER or PERF_AVERAGE_BULK.

PERF_AVERAGE_BULK
0x40020500

The 64-bit counter data is generally used to show an average metric, such as bytes, for an operation. The client takes the difference in this value between subsequent queries and divides that value by the difference in the value of the BaseCounterId counter.

PERF_OBJ_TIME_TIMER
0x20610500

The 64-bit counter data is used as a server-specific timer. The client takes the difference in the counter data between subsequent queries and then divides that by the difference in time. The time difference is calculated by taking the difference of the PerfTimeId counter between subsequent queries and dividing it by the value of the PerfFreqId counter.

PERF_PRECISION_100NS_TIMER
0x20570500

The 64-bit counter data is used as a precise elapsed timer. The client takes the difference in the counter data between subsequent queries and then divides that by the value of the difference in the BaseCounterId counter; the BaseCounterId counter represents a clock time that should be updated at a frequency of 100 nanoseconds.

PERF_PRECISION_SYSTEM_TIMER
0x20470500

The 64-bit counter data is used as an elapsed timer. The client takes the difference in the counter data from subsequent queries and divides it by the difference in the counter data of the BaseCounterId counter, which serves as a timestamp counter. The client assumes the frequency of the clock is the same as the system performance timer.

PERF_PRECISION_OBJECT_TIMER
0x20670500

The 64-bit counter data is used as a precise elapsed timer. The client takes the difference in the counter data between subsequent queries and divides that by the value of the difference in time. This difference is calculated by taking the difference between subsequent queries of the PerfTimeId counter and dividing it by the frequency, which is the value of the PerfFreqId counter.

PERF_100NSEC_TIMER
0x20510500

The 64-bit counter data is used to indicate the ratio of active time over elapsed time. The client takes the difference in the counter data between subsequent queries and then divides that by the sample interval; the frequency of the client clock is assumed to be 100 nanoseconds. The value is displayed as a percentage.

PERF_100NSEC_TIMER_INV
0x21510500

The 64-bit counter data is the inverse of the PERF_100NSEC_TIMER; it shows the ratio of inactive time over elapsed time. The client takes the difference in this counter value between subsequent queries and then divides it by the sample interval; this result is subtracted from 1 and then displayed as a percentage. The frequency of the client clock in this calculation is assumed to be 100 nanoseconds.

PERF_COUNTER_MULTI_TIMER
0x22410500

The 64-bit counter data is used to indicate the average ratio of active time over elapsed time; it is used when there are multiple instances, such as disks that are being monitored. The client takes the difference in the counter data between subsequent queries and divides it by the sample interval. The client uses the frequency of the system performance time to calculate elapsed time. This ratio is then divided by the value of the MultiId counter and is displayed as a percentage.

PERF_COUNTER_MULTI_TIMER_INV
0x23410500

The 64-bit counter data is the inverse of the PERF_COUNTER_MULTI_TIMER. The client takes the difference in the counter data between subsequent queries and divides it by the sample interval. The client uses the frequency of the system performance time. This value is then subtracted from the value of the MultiId counter and is displayed as a percentage.

PERF_100NSEC_MULTI_TIMER
0x22510500

The 64-bit counter data is used to indicate the average ratio of active time over elapsed time; it is used when there are multiple instances, such as disks that are being monitored. The client takes the difference in the counter data between subsequent queries and divides it by the sample interval. The client uses the frequency of 100 nanoseconds to calculate elapsed time. This ratio is then divided by the value of the MultiId counter and is displayed as a percentage.

PERF_100NSEC_MULTI_TIMER_INV
0x23510500

The 64-bit counter data is the inverse of the PERF_100NSEC_MULTI_TIMER. The client takes the difference in the counter data between subsequent queries and then divides it by the sample interval; the client uses the frequency of 100 nanoseconds to calculate elapsed time. This value is then subtracted from the value of the MultiId counter; it is displayed as a percentage.

PERF_RAW_FRACTION
0x20020400

The 32-bit counter data is used to show a ratio between two values. The client takes the counter data and divides it by the value of the BaseCounterId counter; it displays this ratio as a percentage.

PERF_RAW_BASE
0x40030403

The 32-bit counter data is used by the client in calculations involving the PERF_RAW_FRACTION counter. The client SHOULD NOT display this counter.

PERF_LARGE_RAW_FRACTION
0x20020500

The counter data is similar to PERF_RAW_FRACTION, except that it is a 64-bit value.

PERF_LARGE_RAW_BASE
0x40030500

The 64-bit counter data is used by the client in calculations that involve PERF_LARGE_RAW_FRACTION, PERF_PRECISION_SYSTEM_TIMER, and PERF_PRECISION_100NS_TIMER counters.

Attrib: The counter attributes describe certain properties that can be combined in certain cases. The value MUST be one or more of the following.

Value Meaning

0x0000000000000001

Reference. The query on the server MUST dereference the counter to obtain the value.<2>

0x0000000000000002

No display. Instructs the client consumer querying for performance counter data not to display the counter value.

0x0000000000000004

No group separator. Instructs the client consumer querying performance counter data to display the counter values as a single number without commas between digits.

0x0000000000000008

Display as real. Instructs the client consumer querying performance counter to display the counter value as a real number.

0x0000000000000010

Display as hexadecimal. Instructs the client consumer querying performance counter to display the counter value as a hexadecimal number.

Note that only certain combinations of the preceding possible values are allowed.

  • The "Reference" value (0x0000000000000001) can be specified with any other value.

  • The "No display" value (0x0000000000000002) MUST NOT be specified with the "No group separator", "Display as real" or "Display as hex" values.

  • The "No group separator" (0x0000000000000004) or the "Display as real" (0x0000000000000008) values MUST NOT be specified with the "Display as hex" value.

DetailLevel: The detail level of the counter. The value MUST be one of the following.

Value Meaning

0x00000064

Novice level. Designed to be accessed by casual users who do not have detailed system knowledge.

0x000000C8

Advanced level. Designed to be accessed by IT administrators who may be monitoring multiple machines.

DefaultScale: Indicates the amount by which the counter value is scaled. Valid values are from 0xFFFFFFF6 to 0x0000000A (-10 to 10 decimal). For example, if the value of the counter is 0x0000000A (10 decimal) and the default scale is 0x00000002 (2 decimal), the counter value that is calculated by the client MUST be 0x000003E8 (1000 decimal).

BaseCounterId: The CounterId of another counter in the counterset whose value is used by the client in calculating this counter's value. The type of calculation depends of the type of the performance counter.

For example, the difference in the value between queries of a counter are divided by the difference in the value between queries of the counter whose CounterId is BaseCounterId.

The following counter types require a BaseCounterId.

Counter type

Base counter type

PERF_AVERAGE_TIMER

PERF_AVERAGE_BASE

PERF_AVERAGE_BULK

PERF_AVERAGE_BASE

PERF_LARGE_RAW_FRACTION

PERF_LARGE_RAW_BASE

PERF_PRECISION_SYSTEM_TIMER

PERF_LARGE_RAW_BASE

PERF_PRECISION_100NS_TIMER

PERF_LARGE_RAW_BASE

PERF_RAW_FRACTION

PERF_RAW_BASE

PERF_SAMPLE_FRACTION

PERF_SAMPLE_BASE

PerfTimeId: The CounterId of another counter in the counterset whose time value is used to calculate the value of this counter.

In certain cases, such as when calculating rate, it is necessary to gather a time value and take the difference between subsequent queries of this time value to calculate elapsed time on the client. PerfTimeId specifies the CounterId of the counter, which MUST be of type PERF_COUNTER_LARGE_RAWCOUNT, in the counterset that will contain the time value that is used to calculate the rate of this counter. The following counter types require a PerfTimeId (for more information, see [MSFT-COUNTERTYPES]):

  • PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE

  • PERF_ELAPSED_TIME

  • PERF_OBJ_TIME_TIMER

  • PERF_PRECISION_OBJECT_TIMER

PerfFreqId: The CounterId of another counter in the counterset whose frequency value is used to calculate the value of this counter.

In certain cases, such as when rate is calculated, it is necessary to gather a time value and take the difference between subsequent queries of this time value. The time value is then divided by the frequency at which time is updated to calculate the elapsed time, in seconds, on the client. PerfFreqId specifies the CounterId of the counter, which MUST be of type PERF_COUNTER_LARGE_RAWCOUNT, in the counterset whose value will contain the frequency at which time is updated to calculate the rate of this counter. The following counter types require a PerfFreqId (for more information, see [MSFT-COUNTERTYPES]):

  • PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE

  • PERF_ELAPSED_TIME

  • PERF_OBJ_TIME_TIMER

  • PERF_PRECISION_OBJECT_TIMER

MultiId: The CounterId of another counter within the current counterset that is used to calculate the value of this counter.

In certain cases, such as when rate counters are scaled, it is necessary to divide the difference in this counter value between queries by an additional value on the client. The CounterId of the counter is specified by MultiId. It MUST be of type PERF_COUNTER_RAWCOUNT in the counterset that is used as a divisor to this counter value. The following counter types require a MultiId (for more information, see [MSFT-COUNTERTYPES]):

  • PERF_COUNTER_MULTI_TIMER

  • PERF_100NSEC_MULTI_TIMER

  • PERF_100NSEC_MULTI_TIMER_INV

  • PERF_COUNTER_MULTI_TIMER_INV

AggregateFunc: The aggregation function to be performed by the client on the counter if the counterset to which the counter belongs is of type Global Aggregate, Multiple Instance Aggregate, or Global Aggregate History. The client specifies across which counter instances the aggregation are performed if the counterset type is Multiple Instance Aggregate; otherwise, the client MUST aggregate values across all instances of the counterset. One of the following values MUST be specified.

Value Meaning

0x00000000

Undefined.

0x00000001

Total. The sum of the values of the returned counter instances.

0x00000002

Average. The average of the values of the returned counter instances.

0x00000003

Minimum. The minimum value of the returned counter instance values.

0x00000004

Maximum. The maximum value of the returned counter instance values.

Reserved: This is a reserved field. It MUST be set to 0, and MUST be ignored on receipt.

 
Show:
© 2015 Microsoft