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
FieldsModifier and TypeFieldDescriptionprotected static final StringDefault prefix for metrics.The map of gauges.private final StringThe log Prefix.private ReloadableService<T>The service to report on.Fields inherited from interface com.codahale.metrics.MetricFilter
ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected final StringGet the log prefix.Get the underlying map of metrics.Get the service to report on.booleanvoidsetService(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 Details
-
DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
-
gauges
The map of gauges. -
service
The service to report on. -
logPrefix
The log Prefix.
-
-
Constructor Details
-
ReloadableServiceGaugeSet
public ReloadableServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") String metricName) Constructor.- Parameters:
metricName- name to include in metric names produced by this set
-
-
Method Details
-
getService
Get the service to report on.- Returns:
- service to report on
-
setService
Set the service to report on.- Parameters:
svc- service instance
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getMetrics
- Specified by:
getMetricsin interfacecom.codahale.metrics.MetricSet
-
matches
- Specified by:
matchesin interfacecom.codahale.metrics.MetricFilter
-
getMetricMap
Get the underlying map of metrics.- Returns:
- map of metrics
-
getLogPrefix
Get the log prefix.- Returns:
- the log prefix (usually the metric name).
-