Package io.opencensus.implcore.metrics
Class DoubleGaugeImpl
- java.lang.Object
-
- io.opencensus.metrics.DoubleGauge
-
- io.opencensus.implcore.metrics.DoubleGaugeImpl
-
- All Implemented Interfaces:
Meter
public final class DoubleGaugeImpl extends DoubleGauge implements Meter
Implementation ofDoubleGauge.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoubleGaugeImpl.PointImplImplementation ofDoubleGauge.DoublePoint.-
Nested classes/interfaces inherited from class io.opencensus.metrics.DoubleGauge
DoubleGauge.DoublePoint
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<LabelValue>constantLabelValuesprivate java.util.List<LabelValue>defaultLabelValuesprivate intlabelKeysSizeprivate MetricDescriptormetricDescriptorprivate java.util.Map<java.util.List<LabelValue>,DoubleGaugeImpl.PointImpl>registeredPoints(package private) static LabelValueUNSET_VALUE
-
Constructor Summary
Constructors Constructor Description DoubleGaugeImpl(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys, java.util.Map<LabelKey,LabelValue> constantLabels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes allTimeSeriesfrom the gauge metric.DoubleGauge.DoublePointgetDefaultTimeSeries()Returns aDoublePointfor a gauge with all labels not set, or default labels.MetricgetMetric(Clock clock)Provides aMetricwith one or moreTimeSeries.MetricDescriptorgetMetricDescriptor()Provides aMetricDescriptor.DoubleGauge.DoublePointgetOrCreateTimeSeries(java.util.List<LabelValue> labelValues)Creates aTimeSeriesand returns aDoublePointif the specifiedlabelValuesis not already associated with this gauge, else returns an existingDoublePoint.private DoubleGauge.DoublePointregisterTimeSeries(java.util.List<LabelValue> labelValues)voidremoveTimeSeries(java.util.List<LabelValue> labelValues)Removes theTimeSeriesfrom the gauge metric, if it is present.
-
-
-
Field Detail
-
UNSET_VALUE
static final LabelValue UNSET_VALUE
-
metricDescriptor
private final MetricDescriptor metricDescriptor
-
registeredPoints
private volatile java.util.Map<java.util.List<LabelValue>,DoubleGaugeImpl.PointImpl> registeredPoints
-
labelKeysSize
private final int labelKeysSize
-
defaultLabelValues
private final java.util.List<LabelValue> defaultLabelValues
-
constantLabelValues
private final java.util.List<LabelValue> constantLabelValues
-
-
Constructor Detail
-
DoubleGaugeImpl
DoubleGaugeImpl(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys, java.util.Map<LabelKey,LabelValue> constantLabels)
-
-
Method Detail
-
getOrCreateTimeSeries
public DoubleGauge.DoublePoint getOrCreateTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:DoubleGaugeCreates aTimeSeriesand returns aDoublePointif the specifiedlabelValuesis not already associated with this gauge, else returns an existingDoublePoint.It is recommended to keep a reference to the DoublePoint instead of always calling this method for manual operations.
- Specified by:
getOrCreateTimeSeriesin classDoubleGauge- Parameters:
labelValues- the list of label values. The number of label values must be the same to that of the label keys passed toMetricRegistry.addDoubleGauge(java.lang.String, java.lang.String, java.lang.String, java.util.List<io.opencensus.metrics.LabelKey>).- Returns:
- a
DoublePointthe value of single gauge.
-
getDefaultTimeSeries
public DoubleGauge.DoublePoint getDefaultTimeSeries()
Description copied from class:DoubleGaugeReturns aDoublePointfor a gauge with all labels not set, or default labels.- Specified by:
getDefaultTimeSeriesin classDoubleGauge- Returns:
- a
DoublePointfor a gauge with all labels not set, or default labels.
-
removeTimeSeries
public void removeTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:DoubleGaugeRemoves theTimeSeriesfrom the gauge metric, if it is present. i.e. references to previousDoublePointobjects are invalid (not part of the metric).- Specified by:
removeTimeSeriesin classDoubleGauge- Parameters:
labelValues- the list of label values.
-
clear
public void clear()
Description copied from class:DoubleGaugeRemoves allTimeSeriesfrom the gauge metric. i.e. references to all previousDoublePointobjects are invalid (not part of the metric).- Specified by:
clearin classDoubleGauge
-
getMetricDescriptor
public MetricDescriptor getMetricDescriptor()
Description copied from interface:MeterProvides aMetricDescriptor.- Specified by:
getMetricDescriptorin interfaceMeter- Returns:
- a
MetricDescriptor.
-
registerTimeSeries
private DoubleGauge.DoublePoint registerTimeSeries(java.util.List<LabelValue> labelValues)
-
-