TaskHub.Shared

Gauge Metric

A Gauge is a metric that represents a single numerical value that can arbitrarily go up and down. It is used to measure values that can fluctuate, such as memory usage or the number of active connections.

Factory

IGaugeMetricFactory is an extension of IMetricServiceFactory that provides methods to create and manage Gauge metrics services.

public interface IGaugeMetricFactory : IMetricServiceFactory<IGaugeMetric>;

Service

IGaugeMetricService provides methods to interact with Gauge metrics.

public interface IGaugeMetricService : IMetricService
{
    void Set(double increment);
    void Set(double increment, params (string key, string value)[] labels);
}

Usage

public class SomeClass(IGaugeMetric metric)
{
    public void SomeMethod()
    {
	    metric.Set(1, ("label1", "value1"), ("label2", "value2"));
    }
}