Package io.opencensus.metrics
Class LongGauge.NoopLongGauge
java.lang.Object
io.opencensus.metrics.LongGauge
io.opencensus.metrics.LongGauge.NoopLongGauge
- Enclosing class:
LongGauge
No-op implementations of LongGauge class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
No-op implementations of LongPoint class.Nested classes/interfaces inherited from class io.opencensus.metrics.LongGauge
LongGauge.LongPoint
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes allTimeSeries
from the gauge metric.(package private) static LongGauge.NoopLongGauge
Returns aLongPoint
for a gauge with all labels not set, or default labels.getOrCreateTimeSeries
(List<LabelValue> labelValues) Creates aTimeSeries
and returns aLongPoint
if the specifiedlabelValues
is not already associated with this gauge, else returns an existingLongPoint
.void
removeTimeSeries
(List<LabelValue> labelValues) Removes theTimeSeries
from the gauge metric, if it is present.Methods inherited from class io.opencensus.metrics.LongGauge
newNoopLongGauge
-
Field Details
-
labelKeysSize
private final int labelKeysSize
-
-
Constructor Details
-
NoopLongGauge
Creates a newNoopLongPoint
.
-
-
Method Details
-
create
-
getOrCreateTimeSeries
Description copied from class:LongGauge
Creates aTimeSeries
and returns aLongPoint
if the specifiedlabelValues
is not already associated with this gauge, 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 classLongGauge
- Parameters:
labelValues
- the list of label values. The number of label values must be the same to that of the label keys passed toMetricRegistry.addLongGauge(java.lang.String, java.lang.String, java.lang.String, java.util.List<io.opencensus.metrics.LabelKey>)
.- Returns:
- a
LongPoint
the value of single gauge.
-
getDefaultTimeSeries
Description copied from class:LongGauge
Returns aLongPoint
for a gauge with all labels not set, or default labels.- Specified by:
getDefaultTimeSeries
in classLongGauge
- Returns:
- a
LongPoint
for a gauge with all labels not set, or default labels.
-
removeTimeSeries
Description copied from class:LongGauge
Removes theTimeSeries
from the gauge metric, if it is present. i.e. references to previousLongPoint
objects are invalid (not part of the metric).- Specified by:
removeTimeSeries
in classLongGauge
- Parameters:
labelValues
- the list of label values.
-
clear
public void clear()Description copied from class:LongGauge
Removes allTimeSeries
from the gauge metric. i.e. references to all previousLongPoint
objects are invalid (not part of the metric).
-