Class MetricsServiceImpl
- java.lang.Object
-
- org.apache.sling.commons.metrics.internal.MetricsServiceImpl
-
- All Implemented Interfaces:
MetricsService
public class MetricsServiceImpl extends java.lang.Object implements MetricsService
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.commons.metrics.MetricsService
NOOP
-
-
Constructor Summary
Constructors Constructor Description MetricsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A> AadaptTo(java.lang.Class<A> type)Adapts the service to the specified type.Countercounter(java.lang.String name)Creates a newCounterand registers it under the given name.Histogramhistogram(java.lang.String name)Creates a newHistogramand registers it under the given name.Metermeter(java.lang.String name)Creates a newMeterand registers it under the given name.Timertimer(java.lang.String name)Creates a newTimerand registers it under the given name.
-
-
-
Method Detail
-
timer
public Timer timer(java.lang.String name)
Description copied from interface:MetricsServiceCreates a newTimerand registers it under the given name. If a timer with same name exists then same instance is returned- Specified by:
timerin interfaceMetricsService- Parameters:
name- the name of the metric- Returns:
- a new
Timer
-
histogram
public Histogram histogram(java.lang.String name)
Description copied from interface:MetricsServiceCreates a newHistogramand registers it under the given name. If a histogram with same name exists then same instance is returned.- Specified by:
histogramin interfaceMetricsService- Parameters:
name- the name of the metric- Returns:
- a new
Histogram
-
counter
public Counter counter(java.lang.String name)
Description copied from interface:MetricsServiceCreates a newCounterand registers it under the given name. If a counter with same name exists then same instance is returned- Specified by:
counterin interfaceMetricsService- Parameters:
name- the name of the metric- Returns:
- a new
Counter
-
meter
public Meter meter(java.lang.String name)
Description copied from interface:MetricsServiceCreates a newMeterand registers it under the given name. If a meter with same name exists then same instance is returned- Specified by:
meterin interfaceMetricsService- Parameters:
name- the name of the metric- Returns:
- a new
Meter
-
adaptTo
public <A> A adaptTo(java.lang.Class<A> type)
Description copied from interface:MetricsServiceAdapts the service to the specified type. This can be used to get instance to underlyingMetricRegistry- Specified by:
adaptToin interfaceMetricsService- Type Parameters:
A- The type to which this metric is to be adapted.- Parameters:
type- Class object for the type to which this metric is to be adapted.- Returns:
- The object, of the specified type, to which this metric has been adapted or null if this metric cannot be adapted to the specified type.
-
-