Interface: MetricMeter
common.MetricMeter
A meter for creating metrics to record values on.
The Metric API is an experimental feature and may be subject to change.
Methods
createCounter
▸ createCounter(name
, unit?
, description?
): MetricCounter
Create a new counter metric that supports adding values.
Parameters
Name | Type | Description |
---|---|---|
name | string | Name for the counter metric. |
unit? | string | Unit for the counter metric. Optional. |
description? | string | Description for the counter metric. Optional. |
Returns
createGauge
▸ createGauge(name
, valueType?
, unit?
, description?
): MetricGauge
Create a new gauge metric that supports setting values.
Parameters
Name | Type | Description |
---|---|---|
name | string | Name for the gauge metric. |
valueType? | NumericMetricValueType | Type of value to set. Defaults to int . |
unit? | string | Unit for the gauge metric. Optional. |
description? | string | Description for the gauge metric. Optional. |
Returns
createHistogram
▸ createHistogram(name
, valueType?
, unit?
, description?
): MetricHistogram
Create a new histogram metric that supports recording values.
Parameters
Name | Type | Description |
---|---|---|
name | string | Name for the histogram metric. |
valueType? | NumericMetricValueType | Type of value to record. Defaults to int . |
unit? | string | Unit for the histogram metric. Optional. |
description? | string | Description for the histogram metric. Optional. |
Returns
withTags
▸ withTags(tags
): MetricMeter
Return a clone of this meter, with additional tags. All metrics created off the meter will have the tags.
Parameters
Name | Type | Description |
---|---|---|
tags | MetricTags | Tags to append. |