Table of Contents

Class MetricGauge<T>

Namespace
Temporalio.Common
Assembly
Temporalio.dll

Metric for setting values on a gauge.

public abstract class MetricGauge<T> : Metric<T> where T : struct

Type Parameters

T

Type of value for the metric.

Inheritance
MetricGauge<T>
Inherited Members

Constructors

MetricGauge(string, string?, string?)

Initializes a new instance of the MetricGauge<T> class.

protected MetricGauge(string name, string? unit = null, string? description = null)

Parameters

name string

The name of the gauge.

unit string

The optional unit of measurement for the values recorded by the gauge.

description string

The optional description of the gauge.

Methods

Set(T, IEnumerable<KeyValuePair<string, object>>?)

Set the given value on the gauge.

public abstract void Set(T value, IEnumerable<KeyValuePair<string, object>>? extraTags = null)

Parameters

value T

Value to record. Currently this can only be a positive integer.

extraTags IEnumerable<KeyValuePair<string, object>>

Extra tags if any. If this is called multiple times with the same tags, use WithTags(IEnumerable<KeyValuePair<string, object>>) for better performance.

WithTags(IEnumerable<KeyValuePair<string, object>>)

Create a new gauge with the given tags.

public abstract MetricGauge<T> WithTags(IEnumerable<KeyValuePair<string, object>> tags)

Parameters

tags IEnumerable<KeyValuePair<string, object>>

Tags to append to existing tags.

Returns

MetricGauge<T>

New gauge.