Class DerivedLongGauge.NoopDerivedLongGauge

  • Enclosing class:
    DerivedLongGauge

    private static final class DerivedLongGauge.NoopDerivedLongGauge
    extends DerivedLongGauge
    No-op implementations of DerivedLongGauge class.
    • Field Detail

      • labelKeysSize

        private final int labelKeysSize
    • Constructor Detail

      • NoopDerivedLongGauge

        NoopDerivedLongGauge​(java.lang.String name,
                             java.lang.String description,
                             java.lang.String unit,
                             java.util.List<LabelKey> labelKeys)
        Creates a new NoopDerivedLongGauge.
    • Method Detail

      • createTimeSeries

        public <T> void createTimeSeries​(java.util.List<LabelValue> labelValues,
                                         T obj,
                                         ToLongFunction<T> function)
        Description copied from class: DerivedLongGauge
        Creates a TimeSeries. The value of a single point in the TimeSeries is observed from a callback function. This function is invoked whenever metrics are collected, meaning the reported value is up-to-date. It keeps a WeakReference to the object and it is the user's responsibility to manage the lifetime of the object.
        Specified by:
        createTimeSeries in class DerivedLongGauge
        Type Parameters:
        T - the type of the object upon which the function derives a measurement.
        Parameters:
        labelValues - the list of label values.
        obj - the state object from which the function derives a measurement.
        function - the function to be called.
      • removeTimeSeries

        public void removeTimeSeries​(java.util.List<LabelValue> labelValues)
        Description copied from class: DerivedLongGauge
        Removes the TimeSeries from the gauge metric, if it is present.
        Specified by:
        removeTimeSeries in class DerivedLongGauge
        Parameters:
        labelValues - the list of label values.