Package io.opencensus.metrics
Class DerivedLongCumulative.NoopDerivedLongCumulative
- java.lang.Object
-
- io.opencensus.metrics.DerivedLongCumulative
-
- io.opencensus.metrics.DerivedLongCumulative.NoopDerivedLongCumulative
-
- Enclosing class:
- DerivedLongCumulative
private static final class DerivedLongCumulative.NoopDerivedLongCumulative extends DerivedLongCumulative
No-op implementations of DerivedLongCumulative class.
-
-
Field Summary
Fields Modifier and Type Field Description private int
labelKeysSize
-
Constructor Summary
Constructors Constructor Description NoopDerivedLongCumulative(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
Creates a newNoopDerivedLongCumulative
.
-
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 DerivedLongCumulative.NoopDerivedLongCumulative
create(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
<T> void
createTimeSeries(java.util.List<LabelValue> labelValues, T obj, ToLongFunction<T> function)
Creates aTimeSeries
.void
removeTimeSeries(java.util.List<LabelValue> labelValues)
Removes theTimeSeries
from the cumulative metric, if it is present.-
Methods inherited from class io.opencensus.metrics.DerivedLongCumulative
newNoopDerivedLongCumulative
-
-
-
-
Constructor Detail
-
NoopDerivedLongCumulative
NoopDerivedLongCumulative(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
Creates a newNoopDerivedLongCumulative
.
-
-
Method Detail
-
create
static DerivedLongCumulative.NoopDerivedLongCumulative create(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
-
createTimeSeries
public <T> void createTimeSeries(java.util.List<LabelValue> labelValues, T obj, ToLongFunction<T> function)
Description copied from class:DerivedLongCumulative
Creates aTimeSeries
. The value of a single point in the TimeSeries is observed from a callback function. This function is invoked whenever metrics are collected, meaning the reported value is up-to-date. It keeps aWeakReference
to the object and it is the user's responsibility to manage the lifetime of the object.- Specified by:
createTimeSeries
in classDerivedLongCumulative
- Type Parameters:
T
- the type of the object upon which the function derives a measurement.- Parameters:
labelValues
- the list of label values.obj
- the state object from which the function derives a measurement.function
- the function to be called.
-
removeTimeSeries
public void removeTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:DerivedLongCumulative
Removes theTimeSeries
from the cumulative metric, if it is present.- Specified by:
removeTimeSeries
in classDerivedLongCumulative
- Parameters:
labelValues
- the list of label values.
-
clear
public void clear()
Description copied from class:DerivedLongCumulative
Removes allTimeSeries
from the cumulative metric.- Specified by:
clear
in classDerivedLongCumulative
-
-