counter Element

Use the counter element to define a counter.

Usage

<counter
  id = "Integer"
  symbol = "String"
  uri = "String"
  name = "String"
  description = "String"
  type = "String"
  baseID = "Integer"
  detailLevel = "String"
  defaultScale = " Integer"
  aggregate = "String"
  perfTimeID = "Integer"
  perfFreqID = "Integer"
>
  child elements
</counter>

Attributes

Attribute Type Required Description

aggregate

String

No

The aggregation function to apply if the instances attribute of counterSet is globalAggregate, multipleAggregate, or globalAggregateHistory.

The following are the possible aggregation functions that you can apply:

max

The maximum counter value is returned.

min

The minimum counter value is returned.

avg

The average counter value is returned.

sum

The sum of the counter values is returned.

undefined

Do not aggregate this counter.

baseID

Integer

No

The identifier of another counter within the same counter set, whose value is used to calculate this counter's value.

The following counter types require a base counter.

PERF_AVERAGE_TIMER

Requires the PERF_AVERAGE_BASE base counter.

PERF_AVERAGE_BULK

Requires the PERF_AVERAGE_BASE base counter.

PERF_COUNTER_MULTI_TIMER_INV

Requires the PERF_COUNTER_MULTI_BASE base counter.

PERF_LARGE_RAW_FRACTION

Requires the PERF_LARGE_RAW_BASE base counter.

PERF_PRECISION_100NS_TIMER

Requires the PERF_LARGE_RAW_BASE base counter.

PERF_RAW_FRACTION

Requires the PERF_RAW_BASE base counter.

PERF_SAMPLE_FRACTION

Requires the PERF_SAMPLE_BASE base counter.

defaultScale

Integer

No

The scale factor to apply to the counter value (factor * counter value). The default is zero if no scale is applied. Valid values range from -10 to 10 (0.0000000001 - 1000000000). If this value is zero, the scale value is 1; if this value is 1, the scale value is 10; if this value is –1, the scale value is .10; and so on.

description

String

No

A short description of the counter. You do not have to specify this attribute if the counter includes the noDisplay attribute.

detailLevel

String

Yes

Specifies the target audience for the counter details.

Possible values are:

standard

Display details about the counter that a typical user would understand.

advanced

Display details about the counter that an advanced user would understand.

id

Integer

Yes

A unique number that identifies the counter within the counter set.

name

String

No

The name of the counter. Must be less than 1,024 characters. The name is case-sensitive.

You do not have to specify this attribute if the counter includes the noDisplay attribute.

perfFreqID

Integer

No

The identifier of another counter within the same counter set, whose frequency value is used to calculate this counter's value.

The following counter types require a frequency. The PERF_COUNTER_LARGE_RAWCOUNT counter type contains the time stamp value.

PERF_COUNTER_OBJECT_TIME_QUEUELEN_TYPE PERF_ELAPSED_TIME PERF_OBJ_TIME_TIMER PERF_PRECISION_OBJECT_TIMER

perfTimeID

Integer

No

The identifier of another counter within the same counter set, whose time stamp value is used to calculate this counter's value.

The following counter types require a time stamp. The PERF_COUNTER_LARGE_RAWCOUNT counter type contains the time stamp value.

PERF_COUNTER_OBJECT_TIME_QUEUELEN_TYPE PERF_ELAPSED_TIME PERF_OBJ_TIME_TIMER PERF_PRECISION_OBJECT_TIMER

symbol

String

No

A symbolic name that identifies the counter. The CTRPP tool creates a constant that you can use when calling functions that require a counter identifier (for example, PerfIncrementULongCounterValue). The name of the constant is the symbolic name.

Windows 7:  Not supported

type

String

Yes

The name of the counter type. For a list of possible counter types, see Counter Types in the Windows 2003 Deployment Guide. The name is case-sensitive—use lowercase.

uri

String

Yes

A unique uniform resource identifier that lets users retrieve counter values from any location.

Child Elements

Element Description

counterAttributes

Groups one or more attributes that specifies how the counter data is retrieved from the counter and how it is displayed in a consumer application.

Child Element Sequence

counterAttributes*

Parent Elements

Element Description

counterSet

Counter set to which this counter belongs.

Remarks

To provide backwards-compatibility, each counter in the counter set should specify the same perfFreqID and perfTimeID values.

Element Information

Can be empty Yes

Send comments about this topic to Microsoft

Build date: 10/15/2009