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 LongCumulative
LongCumulative.LongPoint -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<LabelValue> private final List<LabelValue> private final intprivate final MetricDescriptorprivate 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 TypeMethodDescriptionvoidclear()Removes allTimeSeriesfrom the cumulative metric.Returns aLongPointfor a cumulative with all labels not set, or default labels.Provides aMetricwith one or moreTimeSeries.Provides aMetricDescriptor.getOrCreateTimeSeries(List<LabelValue> labelValues) Creates aTimeSeriesand returns aLongPointif the specifiedlabelValuesis not already associated with this cumulative, else returns an existingLongPoint.private LongCumulative.LongPointregisterTimeSeries(List<LabelValue> labelValues) voidremoveTimeSeries(List<LabelValue> labelValues) Removes theTimeSeriesfrom 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:LongCumulativeCreates aTimeSeriesand returns aLongPointif the specifiedlabelValuesis 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:
getOrCreateTimeSeriesin 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(String, MetricOptions).- Returns:
- a
LongPointthe value of single cumulative.
-
getDefaultTimeSeries
Description copied from class:LongCumulativeReturns aLongPointfor a cumulative with all labels not set, or default labels.- Specified by:
getDefaultTimeSeriesin classLongCumulative- Returns:
- a
LongPointfor a cumulative with all labels not set, or default labels.
-
removeTimeSeries
Description copied from class:LongCumulativeRemoves theTimeSeriesfrom the cumulative metric, if it is present. i.e. references to previousLongPointobjects are invalid (not part of the metric).- Specified by:
removeTimeSeriesin classLongCumulative- Parameters:
labelValues- the list of label values.
-
clear
public void clear()Description copied from class:LongCumulativeRemoves allTimeSeriesfrom the cumulative metric. i.e. references to all previousLongPointobjects are invalid (not part of the metric).- Specified by:
clearin classLongCumulative
-
getMetricDescriptor
Description copied from interface:MeterProvides aMetricDescriptor.- Specified by:
getMetricDescriptorin interfaceMeter- Returns:
- a
MetricDescriptor.
-
registerTimeSeries
-
getMetric
-