Class DerivedLongGaugeImpl

java.lang.Object
io.opencensus.metrics.DerivedLongGauge
io.opencensus.implcore.metrics.DerivedLongGaugeImpl
All Implemented Interfaces:
Meter

public final class DerivedLongGaugeImpl extends DerivedLongGauge implements Meter
Implementation of DerivedLongGauge.
  • Field Details

  • Constructor Details

  • Method Details

    • createTimeSeries

      public <T> void createTimeSeries(List<LabelValue> labelValues, @Nullable 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(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.
    • clear

      public void clear()
      Description copied from class: DerivedLongGauge
      Removes all TimeSeries from the gauge metric.
      Specified by:
      clear in class DerivedLongGauge
    • getMetricDescriptor

      public MetricDescriptor getMetricDescriptor()
      Description copied from interface: Meter
      Provides a MetricDescriptor.
      Specified by:
      getMetricDescriptor in interface Meter
      Returns:
      a MetricDescriptor.
    • getMetric

      @Nullable public Metric getMetric(Clock clock)
      Description copied from interface: Meter
      Provides a Metric with one or more TimeSeries.
      Specified by:
      getMetric in interface Meter
      Parameters:
      clock - the clock used to get the time.
      Returns:
      a Metric.