Class DoubleGaugeImpl

java.lang.Object
io.opencensus.metrics.DoubleGauge
io.opencensus.implcore.metrics.DoubleGaugeImpl

public final class DoubleGaugeImpl extends DoubleGauge
Implementation of DoubleGauge.
  • Method Details

    • getOrCreateTimeSeries

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

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

      Specified by:
      getOrCreateTimeSeries in class DoubleGauge
      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.addDoubleGauge(String, String, String, List).
      Returns:
      a DoublePoint the value of single gauge.
    • getDefaultTimeSeries

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

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

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

      public MetricDescriptor getMetricDescriptor()
    • getMetric

      @Nullable public Metric getMetric(Clock clock)