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