IncrementingEventCounter IncrementingEventCounter IncrementingEventCounter IncrementingEventCounter Class

Definition

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

public ref class IncrementingEventCounter : System::Diagnostics::Tracing::DiagnosticCounter
public class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter
type IncrementingEventCounter = class
    inherit DiagnosticCounter
Public Class IncrementingEventCounter
Inherits DiagnosticCounter
Inheritance
IncrementingEventCounterIncrementingEventCounterIncrementingEventCounterIncrementingEventCounter

Remarks

IncrementingEventCounter is used for keeping track of values that are always increasing, such as the total number of requests, the total number of exceptions thrown, etc. For such metrics, simply reporting the total value is not necessarily useful for monitoring its health. For example, keeping track of how many bytes have been allocated in total for the entire duration of the process is not useful for diagnosing any potential issues from allocating too much memory. A metric that would help us is how many bytes were allocated in the past minute, hour, or some arbitrary time interval, and not the entire duration of the process. IncrementingEventCounter can be used to keep track of and report just the increments over a time interval that was specified by the consumer of the metric.

IncrementingEventCounter does not calculate statistics like mean or standard deviation because it only keeps track of the increments over a period of time.

Constructors

IncrementingEventCounter(String, EventSource) IncrementingEventCounter(String, EventSource) IncrementingEventCounter(String, EventSource) IncrementingEventCounter(String, EventSource)

Initializes a new instance of the IncrementingEventCounter class.

Properties

DisplayName DisplayName DisplayName DisplayName

Gets or sets the display name of the counter.

(Inherited from DiagnosticCounter)
DisplayRateTimeScale DisplayRateTimeScale DisplayRateTimeScale DisplayRateTimeScale

Gets or sets the 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)

Methods

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)
Increment(Double) Increment(Double) Increment(Double) Increment(Double)

Adds a value to a running total that will be published by the counter at the next timer interval.

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 event counter instance.

Applies to