Class MetricsEndpointMetricReader
- java.lang.Object
- org.springframework.boot.actuate.endpoint.MetricsEndpointMetricReader
- All Implemented Interfaces:
MetricReader
public class MetricsEndpointMetricReader extends Object implements MetricReader
MetricReaderthat pulls all current values out of theMetricsEndpoint. No timestamp information is available, so there is no way to check if the values are recent, and they all come out with the default (current time).- Since:
- 1.3.0
Constructor Summary
Constructors Constructor Description MetricsEndpointMetricReader(MetricsEndpoint endpoint)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()The number of metrics known to this reader.Iterable<Metric<?>>findAll()Find all the metrics known to this reader.Metric<?>findOne(String metricName)Find an instance of the metric with the given name (usually the latest recorded value).
Constructor Detail
MetricsEndpointMetricReader
public MetricsEndpointMetricReader(MetricsEndpoint endpoint)
Method Detail
findOne
public Metric<?> findOne(String metricName)
Description copied from interface:MetricReaderFind an instance of the metric with the given name (usually the latest recorded value).- Specified by:
findOnein interfaceMetricReader- Parameters:
metricName- the name of the metric to find- Returns:
- a metric value or null if there are none with that name
findAll
public Iterable<Metric<?>> findAll()
Description copied from interface:MetricReaderFind all the metrics known to this reader.- Specified by:
findAllin interfaceMetricReader- Returns:
- all instances of metrics known to this reader
count
public long count()
Description copied from interface:MetricReaderThe number of metrics known to this reader.- Specified by:
countin interfaceMetricReader- Returns:
- the number of metrics