public class MetricSuppliers extends Object
MetricRegistry.MetricSupplier
based on plugin configuration. This allows us to customize eg. Reservoir
implementations and parameters for timers and histograms.
Custom supplier implementations must provide a zero-args constructor, and may optionally implement
PluginInfoInitialized
interface for configuration - if they don't then
SolrPluginUtils.invokeSetters(Object, Iterable, boolean)
will be used for initialization.
Modifier and Type | Class and Description |
---|---|
static class |
MetricSuppliers.DefaultCounterSupplier
Default
Counter supplier. |
static class |
MetricSuppliers.DefaultHistogramSupplier
Default supplier of
Histogram instances, with configurable reservoir. |
static class |
MetricSuppliers.DefaultMeterSupplier
Default
Meter supplier. |
static class |
MetricSuppliers.DefaultTimerSupplier
Default supplier of
Timer instances, with configurable clock and reservoir. |
static class |
MetricSuppliers.NoOpCounterSupplier
No-op implementation of
Counter supplier. |
static class |
MetricSuppliers.NoOpGauge
No-op implementation of
Gauge . |
static class |
MetricSuppliers.NoOpHistogramSupplier
No-op implementation of
Histogram supplier. |
static class |
MetricSuppliers.NoOpMeterSupplier
No-op implementation of
Meter supplier. |
static interface |
MetricSuppliers.NoOpMetric
Marker interface for all no-op metrics.
|
static class |
MetricSuppliers.NoOpTimerSupplier
No-op implementation of
Timer supplier. |
Modifier and Type | Field and Description |
---|---|
static String |
CLOCK
Clock type parameter.
|
static String |
CLOCK_CPU
CPU-time clock.
|
static String |
CLOCK_USER
User-time clock.
|
static String |
RESERVOIR
Implementation class, must implement
Reservoir . |
static String |
RESERVOIR_EDR_ALPHA
Alpha parameter of
ExponentiallyDecayingReservoir . |
static String |
RESERVOIR_SIZE
Size of reservoir.
|
static String |
RESERVOIR_WINDOW
Time window in seconds of
SlidingTimeWindowReservoir . |
Constructor and Description |
---|
MetricSuppliers() |
Modifier and Type | Method and Description |
---|---|
static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Counter> |
counterSupplier(SolrResourceLoader loader,
PluginInfo info)
Create a
Counter supplier. |
static <T> com.codahale.metrics.Gauge<T> |
getNoOpGauge(com.codahale.metrics.Gauge<T> actual) |
static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Histogram> |
histogramSupplier(SolrResourceLoader loader,
PluginInfo info)
Create a
Histogram supplier. |
static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Meter> |
meterSupplier(SolrResourceLoader loader,
PluginInfo info)
Create a
Meter supplier. |
static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Timer> |
timerSupplier(SolrResourceLoader loader,
PluginInfo info)
Create a
Timer supplier. |
public static final String CLOCK
public static final String CLOCK_USER
public static final String CLOCK_CPU
public static final String RESERVOIR
Reservoir
. Supports non-standard configuration
of the implementations available in metrics-core.public static final String RESERVOIR_SIZE
public static final String RESERVOIR_EDR_ALPHA
ExponentiallyDecayingReservoir
.public static final String RESERVOIR_WINDOW
SlidingTimeWindowReservoir
.public static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Counter> counterSupplier(SolrResourceLoader loader, PluginInfo info)
Counter
supplier.loader
- resource loaderinfo
- plugin configuration, or null for defaultpublic static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Meter> meterSupplier(SolrResourceLoader loader, PluginInfo info)
Meter
supplier.loader
- resource loaderinfo
- plugin configuration, or null for defaultpublic static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Timer> timerSupplier(SolrResourceLoader loader, PluginInfo info)
Timer
supplier.loader
- resource loaderinfo
- plugin configuration, or null for defaultpublic static com.codahale.metrics.MetricRegistry.MetricSupplier<com.codahale.metrics.Histogram> histogramSupplier(SolrResourceLoader loader, PluginInfo info)
Histogram
supplier.info
- plugin configuration, or null for defaultpublic static <T> com.codahale.metrics.Gauge<T> getNoOpGauge(com.codahale.metrics.Gauge<T> actual)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.