Package io.opencensus.implcore.metrics
Class DoubleCumulativeImpl
- java.lang.Object
-
- io.opencensus.metrics.DoubleCumulative
-
- io.opencensus.implcore.metrics.DoubleCumulativeImpl
-
- All Implemented Interfaces:
Meter
public final class DoubleCumulativeImpl extends DoubleCumulative implements Meter
Implementation ofDoubleCumulative.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoubleCumulativeImpl.PointImplImplementation ofDoubleCumulative.DoublePoint.-
Nested classes/interfaces inherited from class io.opencensus.metrics.DoubleCumulative
DoubleCumulative.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>,DoubleCumulativeImpl.PointImpl>registeredPointsprivate TimestampstartTime(package private) static LabelValueUNSET_VALUE
-
Constructor Summary
Constructors Constructor Description DoubleCumulativeImpl(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys, java.util.Map<LabelKey,LabelValue> constantLabels, Timestamp startTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes allTimeSeriesfrom the cumulative metric.DoubleCumulative.DoublePointgetDefaultTimeSeries()Returns aDoublePointfor a cumulative with all labels not set, or default labels.MetricgetMetric(Clock clock)Provides aMetricwith one or moreTimeSeries.MetricDescriptorgetMetricDescriptor()Provides aMetricDescriptor.DoubleCumulative.DoublePointgetOrCreateTimeSeries(java.util.List<LabelValue> labelValues)Creates aTimeSeriesand returns aDoublePointif the specifiedlabelValuesis not already associated with this cumulative, else returns an existingDoublePoint.private DoubleCumulative.DoublePointregisterTimeSeries(java.util.List<LabelValue> labelValues)voidremoveTimeSeries(java.util.List<LabelValue> labelValues)Removes theTimeSeriesfrom the cumulative 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>,DoubleCumulativeImpl.PointImpl> registeredPoints
-
labelKeysSize
private final int labelKeysSize
-
defaultLabelValues
private final java.util.List<LabelValue> defaultLabelValues
-
constantLabelValues
private final java.util.List<LabelValue> constantLabelValues
-
startTime
private final Timestamp startTime
-
-
Constructor Detail
-
DoubleCumulativeImpl
DoubleCumulativeImpl(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys, java.util.Map<LabelKey,LabelValue> constantLabels, Timestamp startTime)
-
-
Method Detail
-
getOrCreateTimeSeries
public DoubleCumulative.DoublePoint getOrCreateTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:DoubleCumulativeCreates aTimeSeriesand returns aDoublePointif the specifiedlabelValuesis not already associated with this cumulative, 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 classDoubleCumulative- Parameters:
labelValues- the list of label values. The number of label values must be the same to that of the label keys passed toMetricRegistry.addDoubleCumulative(java.lang.String, io.opencensus.metrics.MetricOptions).- Returns:
- a
DoublePointthe value of single cumulative.
-
getDefaultTimeSeries
public DoubleCumulative.DoublePoint getDefaultTimeSeries()
Description copied from class:DoubleCumulativeReturns aDoublePointfor a cumulative with all labels not set, or default labels.- Specified by:
getDefaultTimeSeriesin classDoubleCumulative- Returns:
- a
DoublePointfor a cumulative with all labels not set, or default labels.
-
removeTimeSeries
public void removeTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:DoubleCumulativeRemoves theTimeSeriesfrom the cumulative metric, if it is present. i.e. references to previousDoublePointobjects are invalid (not part of the metric).- Specified by:
removeTimeSeriesin classDoubleCumulative- Parameters:
labelValues- the list of label values.
-
clear
public void clear()
Description copied from class:DoubleCumulativeRemoves allTimeSeriesfrom the cumulative metric. i.e. references to all previousDoublePointobjects are invalid (not part of the metric).- Specified by:
clearin classDoubleCumulative
-
getMetricDescriptor
public MetricDescriptor getMetricDescriptor()
Description copied from interface:MeterProvides aMetricDescriptor.- Specified by:
getMetricDescriptorin interfaceMeter- Returns:
- a
MetricDescriptor.
-
registerTimeSeries
private DoubleCumulative.DoublePoint registerTimeSeries(java.util.List<LabelValue> labelValues)
-
-