Table of Contents

Class MetricBase

Namespace
DotCompute.Core.Telemetry
Assembly
DotCompute.Core.dll

Base class for all metric types.

public abstract class MetricBase
Inheritance
MetricBase
Inherited Members

Constructors

MetricBase(string, string, string[])

Initializes a new metric.

protected MetricBase(string name, string help, string[] labelNames)

Parameters

name string
help string
labelNames string[]

Properties

Help

Gets the metric help text.

public string Help { get; }

Property Value

string

LabelNames

Gets the label names for this metric.

public string[] LabelNames { get; }

Property Value

string[]

Name

Gets the metric name.

public string Name { get; }

Property Value

string

Methods

Export(StringBuilder)

Exports this metric in OpenMetrics format.

public abstract void Export(StringBuilder sb)

Parameters

sb StringBuilder

FormatLabels(string[], string[])

Formats labels for export.

protected static string FormatLabels(string[] labelNames, string[] labelValues)

Parameters

labelNames string[]
labelValues string[]

Returns

string