Class MetricHistogram<T>
- Namespace
- Temporalio.Common
- Assembly
- Temporalio.dll
Metric for recording values on a histogram.
public abstract class MetricHistogram<T> : Metric<T> where T : struct
Type Parameters
T
Type of value for the metric.
- Inheritance
-
Metric<T>MetricHistogram<T>
- Inherited Members
Constructors
MetricHistogram(string, string?, string?)
Initializes a new instance of the MetricHistogram<T> class.
protected MetricHistogram(string name, string? unit = null, string? description = null)
Parameters
name
stringThe name of the histogram.
unit
stringThe optional unit of measurement for the values recorded by the histogram.
description
stringThe optional description of the histogram.
Methods
Record(T, IEnumerable<KeyValuePair<string, object>>?)
Record the given value on the histogram.
public abstract void Record(T value, IEnumerable<KeyValuePair<string, object>>? extraTags = null)
Parameters
value
TValue 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 histogram with the given tags.
public abstract MetricHistogram<T> WithTags(IEnumerable<KeyValuePair<string, object>> tags)
Parameters
tags
IEnumerable<KeyValuePair<string, object>>Tags to append to existing tags.
Returns
- MetricHistogram<T>
New histogram.