Package io.opencensus.implcore.metrics
Class LongCumulativeImpl
java.lang.Object
io.opencensus.metrics.LongCumulative
io.opencensus.implcore.metrics.LongCumulativeImpl
- All Implemented Interfaces:
Meter
Implementation of
LongCumulative
.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.opencensus.metrics.LongCumulative
LongCumulative.LongPoint
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<LabelValue> private final List
<LabelValue> private final int
private final MetricDescriptor
private Map
<List<LabelValue>, LongCumulativeImpl.PointImpl> private final Timestamp
(package private) static final LabelValue
-
Constructor Summary
ConstructorsConstructorDescriptionLongCumulativeImpl
(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 aLongPoint
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 aLongPoint
if the specifiedlabelValues
is not already associated with this cumulative, else returns an existingLongPoint
.private LongCumulative.LongPoint
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
-
LongCumulativeImpl
-
-
Method Details
-
getOrCreateTimeSeries
Description copied from class:LongCumulative
Creates aTimeSeries
and returns aLongPoint
if the specifiedlabelValues
is not already associated with this cumulative, else returns an existingLongPoint
.It is recommended to keep a reference to the LongPoint instead of always calling this method for manual operations.
- Specified by:
getOrCreateTimeSeries
in classLongCumulative
- Parameters:
labelValues
- the list of label values. The number of label values must be the same to that of the label keys passed toMetricRegistry.addLongCumulative(java.lang.String, io.opencensus.metrics.MetricOptions)
.- Returns:
- a
LongPoint
the value of single cumulative.
-
getDefaultTimeSeries
Description copied from class:LongCumulative
Returns aLongPoint
for a cumulative with all labels not set, or default labels.- Specified by:
getDefaultTimeSeries
in classLongCumulative
- Returns:
- a
LongPoint
for a cumulative with all labels not set, or default labels.
-
removeTimeSeries
Description copied from class:LongCumulative
Removes theTimeSeries
from the cumulative metric, if it is present. i.e. references to previousLongPoint
objects are invalid (not part of the metric).- Specified by:
removeTimeSeries
in classLongCumulative
- Parameters:
labelValues
- the list of label values.
-
clear
public void clear()Description copied from class:LongCumulative
Removes allTimeSeries
from the cumulative metric. i.e. references to all previousLongPoint
objects are invalid (not part of the metric).- Specified by:
clear
in classLongCumulative
-
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
.
-