Meter.CreateVSCounter<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 VS Counter, which is an instrument that can be used to track counts/sums in monotonic scenarios (always increase/decrease). The VS version of a counter enables additional properties but requires additional work to migrate to OpenTelemetry when available.
public Microsoft.VisualStudio.Telemetry.Metrics.IVSCounter<T> CreateVSCounter<T>(string name, string unit = default, string description = default) where T : struct;
abstract member CreateVSCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.IVSCounter<'T (requires 'T : struct)> (requires 'T : struct)
override this.CreateVSCounter : string * string * string -> Microsoft.VisualStudio.Telemetry.Metrics.IVSCounter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateVSCounter(Of T As Structure) (name As String, Optional unit As String = Nothing, Optional description As String = Nothing) As IVSCounter(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 VS counter.
Implements
Exceptions
Throws if T is not a valid numeric type. For supported types, check documentation: Microsoft.VisualStudio.Telemetry.Metrics.Counter`1.