public interface MetricsCollector
MetricProvider
to provide metrics to Metrics
.Modifier and Type | Method and Description |
---|---|
void |
differentialMetric(String id,
String limitType,
String title,
double currentValue,
String unit)
Provides a differential metric.
|
void |
metric(String title,
double value,
String unit,
MetricState state)
Provides a metric using the given values.
|
void |
metric(String limitType,
String title,
double value,
String unit)
Provides a metric which state is interpreted using the config values a defined by limitType.
|
void metric(@Nonnull String limitType, @Nonnull String title, double value, @Nullable String unit)
Therefore if the given value is less than health.limits.<limitType>.gray if will be GRAY. Respectively health.limits.<limitType>.warning and health.limits.<limitType>.error will be used to determine if it is GREEN, YELLOW or RED. If either of the config values is missing or 0, it will be ignored.
limitType
- the name used to retrieve the limits from the system configtitle
- the name of the metricvalue
- the measured value of the metricunit
- the unit used by value. Can be null if there is no unitvoid metric(String title, double value, String unit, MetricState state)
title
- the name of the metricvalue
- the measured value of the metricunit
- the unit used by value. Can be null if there is no unitstate
- the interpretation of the measured valuevoid differentialMetric(String id, String limitType, String title, double currentValue, String unit)
In contrast to metric(String, String, double, String)
this will not report the absolute value
but the difference to the last measured value. This value will be stored inside a special map, hence an unique
id is required to identify it.
id
- the unique id used to store and retrieve the last measured valuelimitType
- the name used to fetch the limits from the system configurationtitle
- the name of the metriccurrentValue
- the current valueunit
- the unit used to measure the difference between the last and the current valueCopyright © 2018. All rights reserved.