A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracing.pollingcounter below:

PollingCounter Class (System.Diagnostics.Tracing) | Microsoft Learn

PollingCounter Class Definition
public ref class PollingCounter : System::Diagnostics::Tracing::DiagnosticCounter
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class PollingCounter : System.Diagnostics.Tracing.DiagnosticCounter
public class PollingCounter : System.Diagnostics.Tracing.DiagnosticCounter
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type PollingCounter = class
    inherit DiagnosticCounter
type PollingCounter = class
    inherit DiagnosticCounter
Public Class PollingCounter
Inherits DiagnosticCounter
Inheritance
Attributes

PollingCounter is a variant of EventCounter that uses a callback method to poll for values rather than requiring the writer to explicitly call EventCounter.WriteMetric each time a value is tracked, metricProvider is a callback method that polls for values. The PollingCounter instance polls and reports a value retrieved by calling metricProvider exactly once per the interval requested by the listener.

A PollingCounter lives as long as the EventSource that it is attached to unless it is explicitly disposed.

PollingCounter differs from EventCounter in that it takes a callback function to collect metrics on its own rather than requiring the user to call WriteMetric every time.

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

Constructors Properties Methods See also

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4