Package com.persequor.extension.metrics
Class Metric<T>
java.lang.Object
com.persequor.extension.metrics.Metric<T>
- All Implemented Interfaces:
IMetric
A generic metric with a value of type T.
-
Field Summary
FieldsFields inherited from interface com.persequor.extension.metrics.IMetric
PARAM_NODE_ID
-
Constructor Summary
ConstructorsConstructorDescriptionMetric
(T value, IMetricFamily metricFamily) Metric
(T value, IMetricFamily metricFamily, Instant timestamp) -
Method Summary
Modifier and TypeMethodDescriptiongetId()
The id of the metric, this must be unique.getValue()
Add a labelAdd a suffix to be appended at the end of the metric name like so example_metric -> example_metric_suffix An example suffix is _avg so example_metric -> example_metric_avg This does not affect the IMetricFamily name.toString()
-
Field Details
-
LABEL_NAME_PATTERN
-
-
Constructor Details
-
Metric
-
Metric
-
-
Method Details
-
suffix
Description copied from interface:IMetric
Add a suffix to be appended at the end of the metric name like so example_metric -> example_metric_suffix An example suffix is _avg so example_metric -> example_metric_avg This does not affect the IMetricFamily name. -
label
Description copied from interface:IMetric
Add a label -
getLabels
-
getMetricFamily
- Specified by:
getMetricFamily
in interfaceIMetric
-
getValue
-
getId
Description copied from interface:IMetric
The id of the metric, this must be unique. -
getSuffix
-
getTimestamp
- Specified by:
getTimestamp
in interfaceIMetric
- Returns:
- When the measurement was made.
-
toString
-