Interface: MetricHistogram
common.MetricHistogram
A metric that supports recording values on a histogram.
The Metric API is an experimental feature and may be subject to change.
Hierarchy
-
↳
MetricHistogram
Properties
description
• Optional description: string
The description of the metric, if any.
Inherited from
name
• name: string
The name of the metric.
Inherited from
unit
• Optional unit: string
The unit of the metric, if any.
Inherited from
valueType
• valueType: NumericMetricValueType
The type of value to record. Either int or float.
Methods
record
▸ record(value, extraTags?): void
Record the given value on the histogram.
Parameters
| Name | Type | Description |
|---|---|---|
value | number | Value to record. Must be a non-negative number. Value will be casted to the given valueType. Loss of precision may occur if the value is not already of the correct type. |
extraTags? | MetricTags | Extra tags if any. |
Returns
void
withTags
▸ withTags(tags): MetricHistogram
Return a clone of this histogram, with additional tags.
Parameters
| Name | Type | Description |
|---|---|---|
tags | MetricTags | Tags to append to existing tags. |