Package io.opencensus.metrics
Class LongGauge.NoopLongGauge
- java.lang.Object
-
- io.opencensus.metrics.LongGauge
-
- io.opencensus.metrics.LongGauge.NoopLongGauge
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classLongGauge.NoopLongGauge.NoopLongPointNo-op implementations of LongPoint class.-
Nested classes/interfaces inherited from class io.opencensus.metrics.LongGauge
LongGauge.LongPoint
-
-
Field Summary
Fields Modifier and Type Field Description private intlabelKeysSize
-
Constructor Summary
Constructors Constructor Description NoopLongGauge(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 voidclear()Removes allTimeSeriesfrom the gauge metric.(package private) static LongGauge.NoopLongGaugecreate(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)LongGauge.NoopLongGauge.NoopLongPointgetDefaultTimeSeries()Returns aLongPointfor a gauge with all labels not set, or default labels.LongGauge.NoopLongGauge.NoopLongPointgetOrCreateTimeSeries(java.util.List<LabelValue> labelValues)Creates aTimeSeriesand returns aLongPointif the specifiedlabelValuesis not already associated with this gauge, else returns an existingLongPoint.voidremoveTimeSeries(java.util.List<LabelValue> labelValues)Removes theTimeSeriesfrom the gauge metric, if it is present.-
Methods inherited from class io.opencensus.metrics.LongGauge
newNoopLongGauge
-
-
-
-
Constructor Detail
-
NoopLongGauge
NoopLongGauge(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)Creates a newNoopLongPoint.
-
-
Method Detail
-
create
static LongGauge.NoopLongGauge create(java.lang.String name, java.lang.String description, java.lang.String unit, java.util.List<LabelKey> labelKeys)
-
getOrCreateTimeSeries
public LongGauge.NoopLongGauge.NoopLongPoint getOrCreateTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:LongGaugeCreates aTimeSeriesand returns aLongPointif the specifiedlabelValuesis 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:
getOrCreateTimeSeriesin 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
LongPointthe value of single gauge.
-
getDefaultTimeSeries
public LongGauge.NoopLongGauge.NoopLongPoint getDefaultTimeSeries()
Description copied from class:LongGaugeReturns aLongPointfor a gauge with all labels not set, or default labels.- Specified by:
getDefaultTimeSeriesin classLongGauge- Returns:
- a
LongPointfor a gauge with all labels not set, or default labels.
-
removeTimeSeries
public void removeTimeSeries(java.util.List<LabelValue> labelValues)
Description copied from class:LongGaugeRemoves theTimeSeriesfrom the gauge metric, if it is present. i.e. references to previousLongPointobjects are invalid (not part of the metric).- Specified by:
removeTimeSeriesin classLongGauge- Parameters:
labelValues- the list of label values.
-
-