Package net.shibboleth.idp.metrics
Class ReloadableServiceGaugeSet<T>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.metrics.ReloadableServiceGaugeSet<T>
-
- Type Parameters:
T- Type of service we are monitoring
- All Implemented Interfaces:
com.codahale.metrics.Metric,com.codahale.metrics.MetricFilter,com.codahale.metrics.MetricSet,Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
AttributeResolverServiceGaugeSet,MetadataResolverServiceGaugeSet
public class ReloadableServiceGaugeSet<T> extends AbstractInitializableComponent implements com.codahale.metrics.MetricSet, com.codahale.metrics.MetricFilter
A set of gauges for a reloadable service.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringDEFAULT_METRIC_NAMEDefault prefix for metrics.private Map<String,com.codahale.metrics.Metric>gaugesThe map of gauges.private StringlogPrefixThe log Prefix.private ReloadableService<T>serviceThe service to report on.
-
Constructor Summary
Constructors Constructor Description ReloadableServiceGaugeSet(String metricName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected StringgetLogPrefix()Get the log prefix.protected Map<String,com.codahale.metrics.Metric>getMetricMap()Get the underlying map of metrics.Map<String,com.codahale.metrics.Metric>getMetrics()ReloadableService<T>getService()Get the service to report on.booleanmatches(String name, com.codahale.metrics.Metric metric)voidsetService(ReloadableService<T> svc)Set the service to report on.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
DEFAULT_METRIC_NAME
@Nonnull @NotEmpty protected static final String DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
- Constant Field Values
-
gauges
@Nonnull @NonnullElements private final Map<String,com.codahale.metrics.Metric> gauges
The map of gauges.
-
service
@NonnullAfterInit private ReloadableService<T> service
The service to report on.
-
-
Constructor Detail
-
ReloadableServiceGaugeSet
public ReloadableServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") String metricName)
Constructor.- Parameters:
metricName- name to include in metric names produced by this set
-
-
Method Detail
-
getService
@NonnullAfterInit public ReloadableService<T> getService()
Get the service to report on.- Returns:
- service to report on
-
setService
public void setService(@Nonnull ReloadableService<T> svc)Set the service to report on.- Parameters:
svc- service instance
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getMetrics
public Map<String,com.codahale.metrics.Metric> getMetrics()
- Specified by:
getMetricsin interfacecom.codahale.metrics.MetricSet
-
matches
public boolean matches(String name, com.codahale.metrics.Metric metric)
- Specified by:
matchesin interfacecom.codahale.metrics.MetricFilter
-
getMetricMap
@Nonnull @NonnullElements @Live protected Map<String,com.codahale.metrics.Metric> getMetricMap()
Get the underlying map of metrics.- Returns:
- map of metrics
-
-