Package io.opencensus.implcore.metrics
Class DoubleCumulativeImpl
java.lang.Object
io.opencensus.metrics.DoubleCumulative
io.opencensus.implcore.metrics.DoubleCumulativeImpl
- All Implemented Interfaces:
Meter
Implementation of
DoubleCumulative
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Implementation ofDoubleCumulative.DoublePoint
.Nested classes/interfaces inherited from class io.opencensus.metrics.DoubleCumulative
DoubleCumulative.DoublePoint
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<LabelValue> private final List
<LabelValue> private final int
private final MetricDescriptor
private Map
<List<LabelValue>, DoubleCumulativeImpl.PointImpl> private final Timestamp
(package private) static final LabelValue
-
Constructor Summary
ConstructorsConstructorDescriptionDoubleCumulativeImpl
(String name, String description, String unit, List<LabelKey> labelKeys, Map<LabelKey, LabelValue> constantLabels, Timestamp startTime) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes allTimeSeries
from the cumulative metric.Returns aDoublePoint
for a cumulative with all labels not set, or default labels.Provides aMetric
with one or moreTimeSeries
.Provides aMetricDescriptor
.getOrCreateTimeSeries
(List<LabelValue> labelValues) Creates aTimeSeries
and returns aDoublePoint
if the specifiedlabelValues
is not already associated with this cumulative, else returns an existingDoublePoint
.private DoubleCumulative.DoublePoint
registerTimeSeries
(List<LabelValue> labelValues) void
removeTimeSeries
(List<LabelValue> labelValues) Removes theTimeSeries
from the cumulative metric, if it is present.
-
Field Details
-
UNSET_VALUE
-
metricDescriptor
-
registeredPoints
-
labelKeysSize
private final int labelKeysSize -
defaultLabelValues
-
constantLabelValues
-
startTime
-
-
Constructor Details
-
DoubleCumulativeImpl
-
-
Method Details
-
getOrCreateTimeSeries
Description copied from class:DoubleCumulative
Creates aTimeSeries
and returns aDoublePoint
if the specifiedlabelValues
is 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:
getOrCreateTimeSeries
in 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
DoublePoint
the value of single cumulative.
-
getDefaultTimeSeries
Description copied from class:DoubleCumulative
Returns aDoublePoint
for a cumulative with all labels not set, or default labels.- Specified by:
getDefaultTimeSeries
in classDoubleCumulative
- Returns:
- a
DoublePoint
for a cumulative with all labels not set, or default labels.
-
removeTimeSeries
Description copied from class:DoubleCumulative
Removes theTimeSeries
from the cumulative metric, if it is present. i.e. references to previousDoublePoint
objects are invalid (not part of the metric).- Specified by:
removeTimeSeries
in classDoubleCumulative
- Parameters:
labelValues
- the list of label values.
-
clear
public void clear()Description copied from class:DoubleCumulative
Removes allTimeSeries
from the cumulative metric. i.e. references to all previousDoublePoint
objects are invalid (not part of the metric).- Specified by:
clear
in classDoubleCumulative
-
getMetricDescriptor
Description copied from interface:Meter
Provides aMetricDescriptor
.- Specified by:
getMetricDescriptor
in interfaceMeter
- Returns:
- a
MetricDescriptor
.
-
registerTimeSeries
-
getMetric
Description copied from interface:Meter
Provides aMetric
with one or moreTimeSeries
.
-