public final class MonitorRegistryMetricPoller extends java.lang.Object implements MetricPoller
Monitor
metrics
from a monitor registry.Constructor and Description |
---|
MonitorRegistryMetricPoller()
Creates a new instance using
DefaultMonitorRegistry . |
MonitorRegistryMetricPoller(MonitorRegistry registry)
Creates a new instance using the specified registry.
|
MonitorRegistryMetricPoller(MonitorRegistry registry,
long cacheTTL,
java.util.concurrent.TimeUnit unit)
Creates a new instance using the specified registry and a time limiter.
|
MonitorRegistryMetricPoller(MonitorRegistry registry,
long cacheTTL,
java.util.concurrent.TimeUnit unit,
boolean useLimiter)
Creates a new instance using the specified registry.
|
MonitorRegistryMetricPoller(MonitorRegistry registry,
long cacheTTL,
java.util.concurrent.TimeUnit unit,
boolean useLimiter,
Clock clock)
Creates a new instance using the specified registry.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Metric> |
poll(MetricFilter filter)
Fetch the current values for a set of metrics that match the provided
filter.
|
java.util.List<Metric> |
poll(MetricFilter filter,
boolean reset)
Fetch the current values for a set of metrics that match the provided
filter.
|
void |
shutdown()
Shutsdown the thread executor used for time limiting the get value calls.
|
public MonitorRegistryMetricPoller()
DefaultMonitorRegistry
.public MonitorRegistryMetricPoller(MonitorRegistry registry)
registry
- registry to query for annotated objectspublic MonitorRegistryMetricPoller(MonitorRegistry registry, long cacheTTL, java.util.concurrent.TimeUnit unit)
registry
- registry to query for annotated objectscacheTTL
- how long to cache the filtered monitor list from the registryunit
- time unit for the cache ttlpublic MonitorRegistryMetricPoller(MonitorRegistry registry, long cacheTTL, java.util.concurrent.TimeUnit unit, boolean useLimiter)
registry
- registry to query for annotated objectscacheTTL
- how long to cache the filtered monitor list from the registryunit
- time unit for the cache ttluseLimiter
- whether to use a time limiter for getting the values from the monitorspublic MonitorRegistryMetricPoller(MonitorRegistry registry, long cacheTTL, java.util.concurrent.TimeUnit unit, boolean useLimiter, Clock clock)
registry
- registry to query for annotated objectscacheTTL
- how long to cache the filtered monitor list from the registryunit
- time unit for the cache ttluseLimiter
- whether to use a time limiter for getting the values from the monitorsclock
- clock instance to use to get the timepublic java.util.List<Metric> poll(MetricFilter filter)
poll
in interface MetricPoller
filter
- retricts the set of metricspublic java.util.List<Metric> poll(MetricFilter filter, boolean reset)
poll
in interface MetricPoller
filter
- retricts the set of metricsreset
- ignored. This is kept for backwards compatibility only.public void shutdown()