Meter.CreateCounter<T>(String, String, String) Method
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.
Create a metrics Counter object.
public Microsoft.VisualStudio.Telemetry.Metrics.ICounter<T> CreateCounter<T> (string name, string unit = default, string description = default) where T : struct;
abstract member CreateCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.ICounter<'T (requires 'T : struct)> (requires 'T : struct)
override this.CreateCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.ICounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateCounter(Of T As Structure) (name As String, Optional unit As String = Nothing, Optional description As String = Nothing) As ICounter(Of T)
Type Parameters
- T
The numerical type of the measurement.
Parameters
- name
- String
The instrument name. Cannot be null.
- unit
- String
Optional instrument unit of measurements.
- description
- String
Optional instrument description.
Returns
A new counter.
Implements
Exceptions
Throws if T is not a valid numeric type. For supported types, check documentation: Microsoft.VisualStudio.Telemetry.Metrics.Counter`1.