Redigera

Dela via


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
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class IncrementingEventCounter : System.Diagnostics.Tracing.DiagnosticCounter
type IncrementingEventCounter = class
    inherit DiagnosticCounter
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type IncrementingEventCounter = class
    inherit DiagnosticCounter
Public Class IncrementingEventCounter
Inherits DiagnosticCounter
Inheritance
IncrementingEventCounter
Attributes

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)

Initializes a new instance of the IncrementingEventCounter class.

Properties

DisplayName

Gets or sets the display name of the counter.

(Inherited from DiagnosticCounter)
DisplayRateTimeScale

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

DisplayUnits

Gets or sets the display units of the counter.

(Inherited from DiagnosticCounter)
EventSource

Gets the EventSource that this counter is attached to.

(Inherited from DiagnosticCounter)
Name

Gets the name of this counter.

(Inherited from DiagnosticCounter)

Methods

AddMetadata(String, String)

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

(Inherited from DiagnosticCounter)
Dispose()

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

(Inherited from DiagnosticCounter)
Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
Increment(Double)

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

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

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

Applies to

See also