Package org.apache.pinot.spi.metrics
Interface PinotMetricsRegistry
-
public interface PinotMetricsRegistryA registry of metric instances in Pinot. This interface is to decouple from concrete metrics related classes, like Yammer. This interface should be thread-safe against adds and removes of the same metric.
-
-
Method Summary
Modifier and Type Method Description voidaddListener(PinotMetricsRegistryListener listener)Adds aPinotMetricsRegistryListenerto a collection of listeners that will be notified on metric creation.Map<PinotMetricName,PinotMetric>allMetrics()Returns an unmodifiable map of all metrics and their names.ObjectgetMetricsRegistry()The the actual object of MetricsRegistry.PinotCounternewCounter(PinotMetricName name)Creates a newPinotCounterand registers it under the given metric name.<T> PinotGauge<T>newGauge(PinotMetricName name, PinotGauge<T> gauge)Given a newPinotGauge, registers it under the given metric name.PinotHistogramnewHistogram(PinotMetricName name, boolean biased)Creates a newPinotHistogramand registers it under the given metric name.PinotMeternewMeter(PinotMetricName name, String eventType, TimeUnit unit)Creates a newPinotMeterand registers it under the given metric name.PinotTimernewTimer(PinotMetricName name, TimeUnit durationUnit, TimeUnit rateUnit)Creates a newPinotTimerand registers it under the given metric name.voidremoveMetric(PinotMetricName name)Removes the metric with the given name.voidshutdown()Shut down this registry's thread pools.
-
-
-
Method Detail
-
removeMetric
void removeMetric(PinotMetricName name)
Removes the metric with the given name.- Parameters:
name- the name of the metric
-
newGauge
<T> PinotGauge<T> newGauge(PinotMetricName name, PinotGauge<T> gauge)
Given a newPinotGauge, registers it under the given metric name.- Type Parameters:
T- the type of the value returned by the metric- Parameters:
name- the name of the metricgauge- the gauge metric- Returns:
metric
-
newMeter
PinotMeter newMeter(PinotMetricName name, String eventType, TimeUnit unit)
Creates a newPinotMeterand registers it under the given metric name.- Parameters:
name- the name of the metriceventType- the plural name of the type of events the meter is measuring (e.g.,"requests")unit- the rate unit of the new meter- Returns:
- a new
PinotMeter
-
newCounter
PinotCounter newCounter(PinotMetricName name)
Creates a newPinotCounterand registers it under the given metric name.- Parameters:
name- the name of the metric- Returns:
- a new
PinotCounter
-
newTimer
PinotTimer newTimer(PinotMetricName name, TimeUnit durationUnit, TimeUnit rateUnit)
Creates a newPinotTimerand registers it under the given metric name.- Parameters:
name- the name of the metricdurationUnit- the duration scale unit of the new timerrateUnit- the rate scale unit of the new timer- Returns:
- a new
PinotTimer
-
newHistogram
PinotHistogram newHistogram(PinotMetricName name, boolean biased)
Creates a newPinotHistogramand registers it under the given metric name.- Parameters:
name- the name of the metricbiased- whether or not the histogram should be biased- Returns:
- a new
PinotHistogram
-
allMetrics
Map<PinotMetricName,PinotMetric> allMetrics()
Returns an unmodifiable map of all metrics and their names.- Returns:
- an unmodifiable map of all metrics and their names
-
addListener
void addListener(PinotMetricsRegistryListener listener)
Adds aPinotMetricsRegistryListenerto a collection of listeners that will be notified on metric creation. Listeners will be notified in the order in which they are added. N.B.: The listener will be notified of all existing metrics when it first registers.- Parameters:
listener- the listener that will be notified
-
getMetricsRegistry
Object getMetricsRegistry()
The the actual object of MetricsRegistry.
-
shutdown
void shutdown()
Shut down this registry's thread pools.
-
-