Package io.opencensus.metrics
Class LongCumulative.NoopLongCumulative
- java.lang.Object
-
- io.opencensus.metrics.LongCumulative
-
- io.opencensus.metrics.LongCumulative.NoopLongCumulative
-
- Enclosing class:
- LongCumulative
private static final class LongCumulative.NoopLongCumulative extends LongCumulative
No-op implementations of LongCumulative class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
LongCumulative.NoopLongCumulative.NoopLongPoint
No-op implementations of LongPoint class.-
Nested classes/interfaces inherited from class io.opencensus.metrics.LongCumulative
LongCumulative.LongPoint
-
-
Field Summary
Fields Modifier and Type Field Description private int
labelKeysSize
-
Constructor Summary
Constructors Constructor Description NoopLongCumulative(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
Creates a newNoopLongPoint
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes allTimeSeries
from the cumulative metric.(package private) static LongCumulative.NoopLongCumulative
create(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
LongCumulative.NoopLongCumulative.NoopLongPoint
getDefaultTimeSeries()
Returns aLongPoint
for a cumulative with all labels not set, or default labels.LongCumulative.NoopLongCumulative.NoopLongPoint
getOrCreateTimeSeries(java.util.List<LabelValue> labelValues)
Creates aTimeSeries
and returns aLongPoint
if the specifiedlabelValues
is not already associated with this cumulative, else returns an existingLongPoint
.void
removeTimeSeries(java.util.List<LabelValue> labelValues)
Removes theTimeSeries
from the cumulative metric, if it is present.-
Methods inherited from class io.opencensus.metrics.LongCumulative
newNoopLongCumulative
-
-
-
-
Constructor Detail
-
NoopLongCumulative
NoopLongCumulative(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
Creates a newNoopLongPoint
.
-
-
Method Detail
-
create
static LongCumulative.NoopLongCumulative create(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
-
getOrCreateTimeSeries
public LongCumulative.NoopLongCumulative.NoopLongPoint getOrCreateTimeSeries(java.util.List<LabelValue> labelValues)
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
public LongCumulative.NoopLongCumulative.NoopLongPoint 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
public void removeTimeSeries(java.util.List<LabelValue> labelValues)
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
-
-