Interface PinotMetricsRegistry


  • public interface PinotMetricsRegistry
    A 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 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 new PinotGauge, 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 metric
        gauge - the gauge metric
        Returns:
        metric
      • newMeter

        PinotMeter newMeter​(PinotMetricName name,
                            String eventType,
                            TimeUnit unit)
        Creates a new PinotMeter and registers it under the given metric name.
        Parameters:
        name - the name of the metric
        eventType - 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
      • newTimer

        PinotTimer newTimer​(PinotMetricName name,
                            TimeUnit durationUnit,
                            TimeUnit rateUnit)
        Creates a new PinotTimer and registers it under the given metric name.
        Parameters:
        name - the name of the metric
        durationUnit - the duration scale unit of the new timer
        rateUnit - the rate scale unit of the new timer
        Returns:
        a new PinotTimer
      • newHistogram

        PinotHistogram newHistogram​(PinotMetricName name,
                                    boolean biased)
        Creates a new PinotHistogram and registers it under the given metric name.
        Parameters:
        name - the name of the metric
        biased - 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 a PinotMetricsRegistryListener to 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.