Share via


PERF_COUNTER_DEFINITION (Windows Embedded CE 6.0)

1/5/2010

This structure describes a performance counter.

The Unicode names in this structure must appear in a message file.

typedef struct _PERF_COUNTER_DEFINITION {
    DWORD  ByteLength;
    DWORD  CounterNameTitleIndex;
    LPWSTR CounterNameTitle;
    DWORD  CounterHelpTitleIndex;
    LPWSTR CounterHelpTitle;
    DWORD  DefaultScale;
    DWORD  DetailLevel;
    DWORD  CounterType;
    DWORD  CounterSize;
    DWORD  CounterOffset;
} PERF_COUNTER_DEFINITION;

Members

  • ByteLength
    Contains the length, in bytes, of this structure.
  • CounterNameTitleIndex
    Contains the index of the counter name in the title database of the registry.
  • CounterNameTitle
    A pointer to a string with a terminating null character containing the name of the counter. This member contains NULL, initially, but it can contain a pointer to the actual string after the string is located.
  • CounterHelpTitleIndex
    Contains the index to the Help title for the counter in the title database of the registry.
  • CounterHelpTitle
    A pointer to a string with a terminating null character containing the title of Help. This member contains NULL, initially, but it can contain a pointer to the actual string after the string is located.
  • DefaultScale
    Specifies the power of 10 by which to scale a chart line, assuming the vertical axis is 100. For example, if this value is 0 (zero), the scale value is 1, if this value is 1, the scale value is 10, and if this value is –1, the scale value is .10.
  • DetailLevel
    Specifies the level of detail for the counter. Applications use this value to control display complexity.

    The following table shows possible values for this member.

    Value Description

    PERF_DETAIL_NOVICE

    The data can be understood by an inexperienced user.

    PERF_DETAIL_ADVANCED

    The data is designed for an advanced user.

    PERF_DETAIL_EXPERT

    The data is designed for an expert user.

    PERF_DETAIL_WIZARD

    The data is designed for a system designer.

  • CounterType
    Specifies the type of counter. For information about predefined counter types, see Calculations for Raw Counter Data. Each of the predefined counter types is a combination of the values from the following tables.

    This following table shows values for the data size for a counter.

    Value Description

    PERF_SIZE_DWORD

    The counter data is a DWORD.

    PERF_SIZE_LARGE

    The counter data is a large integer.

    PERF_SIZE_ZERO

    The counter data is a field with 0 (zero) length.

    PERF_SIZE_VARIABLE_LEN

    The size of the counter data is in the CounterSize member.

    The following table shows values that describe the additional contents of the CounterType member.

    Value Description

    PERF_TYPE_NUMBER

    The counter data is a numeric value but not a counter.

    PERF_TYPE_COUNTER

    The counter data is an increasing numeric value.

    PERF_TYPE_TEXT

    The counter data is a text field.

    PERF_TYPE_ZERO

    The counter data is always 0 (zero).

    The following table shows the values for the format of the number if PERF_TYPE_NUMBER is specified.

    Value Description

    PERF_NUMBER_HEX

    The counter data is displayed as a hexadecimal value.

    PERF_NUMBER_DECIMAL

    The counter data is displayed as a decimal value.

    PERF_NUMBER_DEC_1000

    The counter data is divided by 1000 and displayed as a decimal value.

    The following table shows values for the type of counter if PERF_TYPE_COUNTER is specified.

    Value Description

    PERF_COUNTER_VALUE

    The counter value is displayed as is.

    PERF_COUNTER_RATE

    The counter value is divided by the elapsed time.

    PERF_COUNTER_FRACTION

    The counter value is divided by the base value indicated by the next counter if it is of type PERF_COUNTER_BASE, or by the value of the counter subtype.

    PERF_COUNTER_BASE

    The counter value is the base value to be used in fractions.

    PERF_COUNTER_ELAPSED

    The counter value is a start time to be subtracted from the current time.

    PERF_COUNTER_QUEUELEN

    The performance application should use the queue length counter.

    The next counter is the number currently in the queue.

    Multiply the next counter by the current time, which is made up of the units specified by this counter's subtype.

    Add the product to the original value of the counter.

    To obtain the average queue length, divide the result of the addition by the change in time.

    PERF_COUNTER_HISTOGRAM

    The counter value begins or ends a histogram.

    The following table shows values for the subtype of counter if PERF_TYPE_COUNTER is specified.

    Value Description

    PERF_TIMER_TICK

    The frequency of the high-resolution performance counter should be used as the base.

    PERF_TIMER_100NS

    The time base units of the 100-nanosecond timer should be used as the base.

    PERF_OBJECT_TIMER

    The object-timer frequency should be used as the base unit.

    This value is system-defined in this counter's PERF_OBJECT_TYPE definition.

    The following table shows values for type of text if PERF_TYPE_TEXT is specified.

    Value Description

    PERF_TEXT_UNICODE

    The counter data contains Unicode text.

    PERF_TEXT_ASCII

    The counter data contains ASCII text.

    The following table shows values that indicate how to use the counter data in a calculation.

    Value Description

    PERF_DELTA_COUNTER

    The difference between the previous counter value and the current counter value is computed before proceeding.

    PERF_DELTA_BASE

    The difference between the previous base value and the current base value is computed before proceeding.

    PERF_INVERSE_COUNTER

    After other calculations, the counter should be inverted before displaying or converting to a percentage.

    PERF_MULTI_COUNTER

    This value is a sum of counters from several sources, the number of which is indicated by the next counter.

    The following table shows values that indicate the display suffix of the counter data.

    Value Description

    PERF_DISPLAY_NO_SUFFIX

    There is no display suffix.

    PERF_DISPLAY_PER_SEC

    The display suffix is '/sec'.

    PERF_DISPLAY_PERCENT

    The display suffix is '%'.

    PERF_DISPLAY_SECONDS

    The display suffix is 'secs'.

    PERF_DISPLAY_NOSHOW

    The counter value should not be displayed.

  • CounterSize
    Specifies the counter size, in bytes from the PERF_COUNTER_BLOCK structure to the first byte of this counter.
  • CounterOffset
    Specifies the offset from the start of the message file.

Remarks

This structure is part of the performance data provided by the RegQueryValueEx function when the HKEY_PERFORMANCE_DATA key is used.

Requirements

Header windows.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Concepts

Performance Monitoring Structures