Table of Contents

Interface IMetricRecorderFactory

Namespace
Homa.Sdk.Metrics
Assembly
Homa.Sdk.Metrics.Abstractions.dll

Creates IMetricRecorder instances.

public interface IMetricRecorderFactory

Properties

Default

Returns the active metrics recorder factory.

public static IMetricRecorderFactory Default { get; set; }

Property Value

IMetricRecorderFactory

Methods

CreateCounter(string, IEnumerable<IMetricLabel>)

Creates a Counter recorder for metrics. Values in a counter recorder can only go up (or stay the same).

IMetricRecorder CreateCounter(string metricName, IEnumerable<IMetricLabel> labels)

Parameters

metricName string

Name of the metric

labels IEnumerable<IMetricLabel>

(optional) Labels that will be added to all the data points recorded in this recorder.

Returns

IMetricRecorder

Instance of IMetricRecorder representing a counter recorder

CreateCounter(string, string, IEnumerable<IMetricLabel>)

Creates a Counter recorder for metrics. Values in a counter recorder can only go up (or stay the same).

IMetricRecorder CreateCounter(string metricName, string unit, IEnumerable<IMetricLabel> labels)

Parameters

metricName string

Name of the metric

unit string

(optional) Unit that the recorded values represent

labels IEnumerable<IMetricLabel>

(optional) Labels that will be added to all the data points recorded in this recorder.

Returns

IMetricRecorder

Instance of IMetricRecorder representing a counter recorder

CreateGauge(string, IEnumerable<IMetricLabel>)

Creates a Gauge recorder for metrics. Values in a gauge recorder can go up and down.

IMetricRecorder CreateGauge(string metricName, IEnumerable<IMetricLabel> labels)

Parameters

metricName string

Name of the metric

labels IEnumerable<IMetricLabel>

(optional) Labels that will be added to all the data points recorded in this recorder.

Returns

IMetricRecorder

Instance of IMetricRecorder representing a gauge recorder

CreateGauge(string, string, IEnumerable<IMetricLabel>)

Creates a Gauge recorder for metrics. Values in a gauge recorder can go up and down.

IMetricRecorder CreateGauge(string metricName, string unit, IEnumerable<IMetricLabel> labels)

Parameters

metricName string

Name of the metric

unit string

(optional) Unit that the recorded values represent

labels IEnumerable<IMetricLabel>

(optional) Labels that will be added to all the data points recorded in this recorder.

Returns

IMetricRecorder

Instance of IMetricRecorder representing a gauge recorder