Editare

Partajați prin


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

Remarks

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.

Constructors

IncrementingPollingCounter(String, EventSource, Func<Double>)

Initializes a new instance of the IncrementingPollingCounter class.

Properties

DisplayName

Gets or sets the display name of the counter.

(Inherited from DiagnosticCounter)
DisplayRateTimeScale

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

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

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

Applies to

See also