EventCounter Class 
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides the ability to collect statistics for very frequent events through the EventSource class.
public ref class EventCounter : System::Diagnostics::Tracing::DiagnosticCounterpublic ref class EventCounterpublic ref class EventCounter : IDisposable[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public class EventCounter : System.Diagnostics.Tracing.DiagnosticCounterpublic class EventCounter : System.Diagnostics.Tracing.DiagnosticCounterpublic class EventCounterpublic class EventCounter : IDisposable[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type EventCounter = class
    inherit DiagnosticCountertype EventCounter = class
    inherit DiagnosticCountertype EventCounter = classtype EventCounter = class
    interface IDisposablePublic Class EventCounter
Inherits DiagnosticCounterPublic Class EventCounterPublic Class EventCounter
Implements IDisposable- Inheritance
- Inheritance
- 
				EventCounter
- Attributes
- Implements
Remarks
For an example of how to use the EventCounter class, see Introduction Tutorial: How to measure performance for very frequent events using EventCounters.
Constructors
| EventCounter(String, EventSource) | Initializes a new instance of the EventCounter class. | 
Properties
| DisplayName | Gets or sets the display name of the counter.(Inherited from DiagnosticCounter) | 
| 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. | 
| 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 event counter instance. | 
| ToString() | Returns a string that represents the current object.(Inherited from Object) | 
| WriteMetric(Double) | Writes the metric if performance counters are on. | 
| WriteMetric(Single) | Writes the metric if performance counters are on. |