Class LongGaugeImpl

java.lang.Object
io.opencensus.metrics.LongGauge
io.opencensus.implcore.metrics.LongGaugeImpl
All Implemented Interfaces:
Meter

public final class LongGaugeImpl extends LongGauge implements Meter
Implementation of LongGauge.
  • Field Details

  • Constructor Details

  • Method Details

    • getOrCreateTimeSeries

      public LongGauge.LongPoint getOrCreateTimeSeries(List<LabelValue> labelValues)
      Description copied from class: LongGauge
      Creates a TimeSeries and returns a LongPoint if the specified labelValues is not already associated with this gauge, else returns an existing LongPoint.

      It is recommended to keep a reference to the LongPoint instead of always calling this method for manual operations.

      Specified by:
      getOrCreateTimeSeries in class LongGauge
      Parameters:
      labelValues - the list of label values. The number of label values must be the same to that of the label keys passed to MetricRegistry.addLongGauge(String, String, String, List).
      Returns:
      a LongPoint the value of single gauge.
    • getDefaultTimeSeries

      public LongGauge.LongPoint getDefaultTimeSeries()
      Description copied from class: LongGauge
      Returns a LongPoint for a gauge with all labels not set, or default labels.
      Specified by:
      getDefaultTimeSeries in class LongGauge
      Returns:
      a LongPoint for a gauge with all labels not set, or default labels.
    • removeTimeSeries

      public void removeTimeSeries(List<LabelValue> labelValues)
      Description copied from class: LongGauge
      Removes the TimeSeries from the gauge metric, if it is present. i.e. references to previous LongPoint objects are invalid (not part of the metric).
      Specified by:
      removeTimeSeries in class LongGauge
      Parameters:
      labelValues - the list of label values.
    • clear

      public void clear()
      Description copied from class: LongGauge
      Removes all TimeSeries from the gauge metric. i.e. references to all previous LongPoint objects are invalid (not part of the metric).
      Specified by:
      clear in class LongGauge
    • getMetricDescriptor

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

      private LongGauge.LongPoint registerTimeSeries(List<LabelValue> labelValues)
    • 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.