Class AbstractVeniceStats

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DELIMITER  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractVeniceStats​(io.tehuti.metrics.MetricsRepository metricsRepository, java.lang.String name)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected io.tehuti.metrics.MeasurableStat[] avgAndMax()  
      protected io.tehuti.metrics.MeasurableStat[] avgAndTotal()  
      io.tehuti.metrics.MetricsRepository getMetricsRepository()  
      java.lang.String getName()  
      protected java.lang.String getSensorFullName​(java.lang.String sensorName)  
      static java.lang.String getSensorFullName​(java.lang.String resourceName, java.lang.String sensorName)  
      protected boolean isTotalStats()  
      protected io.tehuti.metrics.MeasurableStat[] minAndMax()  
      protected LongAdderRateGauge registerOnlyTotalRate​(java.lang.String sensorName, AbstractVeniceStats totalStats, java.util.function.Supplier<LongAdderRateGauge> totalSensor, Time time)
      Only register sensor for total stats.
      protected io.tehuti.metrics.Sensor registerOnlyTotalSensor​(java.lang.String sensorName, AbstractVeniceStats totalStats, java.util.function.Supplier<io.tehuti.metrics.Sensor> totalSensor, io.tehuti.metrics.MeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerPerStoreAndTotalSensor​(java.lang.String sensorName, AbstractVeniceStats totalStats, java.util.function.Supplier<io.tehuti.metrics.Sensor> totalSensor, io.tehuti.metrics.MeasurableStat... stats)
      Register sensor for both total and per store stats.
      protected io.tehuti.metrics.Sensor registerSensor​(io.tehuti.metrics.NamedMeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorName, io.tehuti.metrics.MeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorFullName, io.tehuti.metrics.MetricConfig config, io.tehuti.metrics.Sensor[] parents, io.tehuti.metrics.MeasurableStat... stats)
      N.B.: This function is private because it requires the full sensor name, which should be generated from getSensorFullName(String), and is therefore less user-friendly for developers of subclasses.
      protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorName, io.tehuti.metrics.Sensor[] parents, io.tehuti.metrics.MeasurableStat... stats)  
      protected void registerSensorAttributeGauge​(java.lang.String sensorName, java.lang.String attributeName, io.tehuti.metrics.stats.AsyncGauge stat)  
      protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(io.tehuti.metrics.NamedMeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(java.lang.String sensorName, io.tehuti.metrics.MeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(java.lang.String resourceName, java.lang.String sensorName, io.tehuti.metrics.MetricConfig config, io.tehuti.metrics.Sensor[] parents, io.tehuti.metrics.MeasurableStat... stats)  
      protected io.tehuti.metrics.Sensor registerSensorWithAggregate​(java.lang.String sensorName, io.tehuti.metrics.MetricConfig config, java.util.function.Supplier<io.tehuti.metrics.MeasurableStat[]> stats)  
      protected io.tehuti.metrics.Sensor registerSensorWithAggregate​(java.lang.String sensorName, java.util.function.Supplier<io.tehuti.metrics.MeasurableStat[]> stats)  
      protected void unregisterAllSensors()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractVeniceStats

        public AbstractVeniceStats​(io.tehuti.metrics.MetricsRepository metricsRepository,
                                   java.lang.String name)
    • Method Detail

      • getMetricsRepository

        public io.tehuti.metrics.MetricsRepository getMetricsRepository()
      • isTotalStats

        protected final boolean isTotalStats()
      • getName

        public final java.lang.String getName()
      • registerSensor

        protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorName,
                                                          io.tehuti.metrics.MeasurableStat... stats)
      • registerSensor

        protected io.tehuti.metrics.Sensor registerSensor​(io.tehuti.metrics.NamedMeasurableStat... stats)
      • registerSensorAttributeGauge

        protected void registerSensorAttributeGauge​(java.lang.String sensorName,
                                                    java.lang.String attributeName,
                                                    io.tehuti.metrics.stats.AsyncGauge stat)
      • registerSensor

        protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorName,
                                                          io.tehuti.metrics.Sensor[] parents,
                                                          io.tehuti.metrics.MeasurableStat... stats)
      • registerSensor

        protected io.tehuti.metrics.Sensor registerSensor​(java.lang.String sensorFullName,
                                                          io.tehuti.metrics.MetricConfig config,
                                                          io.tehuti.metrics.Sensor[] parents,
                                                          io.tehuti.metrics.MeasurableStat... stats)
        N.B.: This function is private because it requires the full sensor name, which should be generated from getSensorFullName(String), and is therefore less user-friendly for developers of subclasses. The other functions which call this one require just the partial sensor name, which is less error-prone.
      • unregisterAllSensors

        protected void unregisterAllSensors()
      • registerSensorWithAggregate

        protected io.tehuti.metrics.Sensor registerSensorWithAggregate​(java.lang.String sensorName,
                                                                       java.util.function.Supplier<io.tehuti.metrics.MeasurableStat[]> stats)
      • registerSensorWithAggregate

        protected io.tehuti.metrics.Sensor registerSensorWithAggregate​(java.lang.String sensorName,
                                                                       io.tehuti.metrics.MetricConfig config,
                                                                       java.util.function.Supplier<io.tehuti.metrics.MeasurableStat[]> stats)
      • registerPerStoreAndTotalSensor

        protected io.tehuti.metrics.Sensor registerPerStoreAndTotalSensor​(java.lang.String sensorName,
                                                                          AbstractVeniceStats totalStats,
                                                                          java.util.function.Supplier<io.tehuti.metrics.Sensor> totalSensor,
                                                                          io.tehuti.metrics.MeasurableStat... stats)
        Register sensor for both total and per store stats. When per-store stats is recorded, the total stats would be recorded as well.
        Parameters:
        sensorName -
        totalStats -
        totalSensor -
        stats -
        Returns:
      • registerOnlyTotalSensor

        protected io.tehuti.metrics.Sensor registerOnlyTotalSensor​(java.lang.String sensorName,
                                                                   AbstractVeniceStats totalStats,
                                                                   java.util.function.Supplier<io.tehuti.metrics.Sensor> totalSensor,
                                                                   io.tehuti.metrics.MeasurableStat... stats)
      • registerOnlyTotalRate

        protected LongAdderRateGauge registerOnlyTotalRate​(java.lang.String sensorName,
                                                           AbstractVeniceStats totalStats,
                                                           java.util.function.Supplier<LongAdderRateGauge> totalSensor,
                                                           Time time)
        Only register sensor for total stats. If not provided, create a new one.
        Parameters:
        sensorName -
        totalStats -
        totalSensor -
        time -
        Returns:
      • registerSensorIfAbsent

        protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(java.lang.String sensorName,
                                                                  io.tehuti.metrics.MeasurableStat... stats)
      • registerSensorIfAbsent

        protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(io.tehuti.metrics.NamedMeasurableStat... stats)
      • registerSensorIfAbsent

        protected io.tehuti.metrics.Sensor registerSensorIfAbsent​(java.lang.String resourceName,
                                                                  java.lang.String sensorName,
                                                                  io.tehuti.metrics.MetricConfig config,
                                                                  io.tehuti.metrics.Sensor[] parents,
                                                                  io.tehuti.metrics.MeasurableStat... stats)
      • getSensorFullName

        protected java.lang.String getSensorFullName​(java.lang.String sensorName)
      • getSensorFullName

        public static java.lang.String getSensorFullName​(java.lang.String resourceName,
                                                         java.lang.String sensorName)
      • avgAndMax

        protected final io.tehuti.metrics.MeasurableStat[] avgAndMax()
      • minAndMax

        protected final io.tehuti.metrics.MeasurableStat[] minAndMax()
      • avgAndTotal

        protected final io.tehuti.metrics.MeasurableStat[] avgAndTotal()