IncrementingPollingCounter IncrementingPollingCounter IncrementingPollingCounter IncrementingPollingCounter Class


Provides a variant of EventCounter for variables that are ever-increasing, such as the number of exceptions in the runtime.

public ref class IncrementingPollingCounter : System::Diagnostics::Tracing::DiagnosticCounter
public class IncrementingPollingCounter : System.Diagnostics.Tracing.DiagnosticCounter
type IncrementingPollingCounter = class
    inherit DiagnosticCounter
Public Class IncrementingPollingCounter
Inherits DiagnosticCounter


IncrementingPollingCounter objects live as long as the EventSource that they are attached to unless they are explicitly disposed.

totalValueProvider is a method used for polling the values at the interval specified by the listener. This method is expected to return an incrementing float value; otherwise, an increment of a negative value may be reported.

IncrementingPollingCounter does not calculate statistics like mean and standard deviation because it only accumulates the counter value. Unlike IncrementingEventCounter, this takes in a polling callback that it can call to update its own metric periodically.

For an example that uses IncrementingPollingCounter inside the runtime as for runtime performance counters, see the CoreCLR source for RuntimeEventSource on GitHub.


IncrementingPollingCounter(String, EventSource, Func<Double>) IncrementingPollingCounter(String, EventSource, Func<Double>) IncrementingPollingCounter(String, EventSource, Func<Double>) IncrementingPollingCounter(String, EventSource, Func<Double>)

Initializes a new instance of the IncrementingPollingCounter class.


DisplayName DisplayName DisplayName DisplayName

Gets or sets the display name of the counter.

(Inherited from DiagnosticCounter)
DisplayRateTimeScale DisplayRateTimeScale DisplayRateTimeScale DisplayRateTimeScale

Gets or sets rate at which this metric should be displayed as.

DisplayUnits DisplayUnits DisplayUnits DisplayUnits

Gets or sets the display units of the counter.

(Inherited from DiagnosticCounter)
EventSource EventSource EventSource EventSource

Gets the EventSource that this counter is attached to.

(Inherited from DiagnosticCounter)
Name Name Name Name

Gets the name of this counter.

(Inherited from DiagnosticCounter)


AddMetadata(String, String) AddMetadata(String, String) AddMetadata(String, String) AddMetadata(String, String)

Adds key-value metadata to the counter that will be included as a part of the payload

(Inherited from DiagnosticCounter)
Dispose() Dispose() Dispose() Dispose()

Removes the counter from the set that the EventSource will report on.

(Inherited from DiagnosticCounter)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string representation of the current incrementing polling counter instance.

Applies to