Package com.nimbusds.common.monitor
Class MonitorRegistries
java.lang.Object
com.nimbusds.common.monitor.MonitorRegistries
Shared monitor registers for Dropwizard metrics and health checks.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
Gets the timeout for entry count gauges.static com.codahale.metrics.health.HealthCheckRegistry
Returns the singleton shared registry for health check instances.static com.codahale.metrics.MetricRegistry
Returns the singleton shared registry for metric instances.static void
register
(com.codahale.metrics.MetricSet metricSet) Registers a metric set.static void
Registers, updates or unregisters a health check.static void
Registers, updates or unregisters a metric.static void
registerEntryCountGauge
(String name, Supplier<Integer> supplier) Registers or updates an entry count gauge according to the configuredcache timeout
.static void
setEntryCountCacheTimeout
(long entryCountCacheTimeout) Sets the timeout for entry count gauges.
-
Method Details
-
getMetricRegistry
Returns the singleton shared registry for metric instances.- Returns:
- The registry.
-
getHealthCheckRegistry
Returns the singleton shared registry for health check instances.- Returns:
- The registry.
-
register
Registers a metric set.- Parameters:
metricSet
- The metric set to register. Ifnull
the method will return immediately.
-
register
Registers, updates or unregisters a metric.- Parameters:
name
- The metric name. Ifnull
the method will return immediately.metric
- The metric,null
to unregister. If a metric with the same name exists it will be replaced.
-
registerEntryCountGauge
Registers or updates an entry count gauge according to the configuredcache timeout
.- Parameters:
name
- The gauge name. Ifnull
the method will return immediately.supplier
- The entry count supplier.
-
getEntryCountCacheTimeout
Gets the timeout for entry count gauges.- Returns:
- The timeout for caching entry count results, in seconds. Zero means no caching, negative disabled readings.
-
setEntryCountCacheTimeout
Sets the timeout for entry count gauges.- Parameters:
entryCountCacheTimeout
- The timeout for caching entry count results, in seconds. Zero means no caching, negative disabled readings.
-
register
Registers, updates or unregisters a health check.- Parameters:
name
- The health check name. Ifnull
the method will return immediately.check
- The health check,null
to unregister. If a metric with the same name exists it will be replaced.
-