Class LongGaugeImpl
java.lang.Object
io.opencensus.metrics.LongGauge
io.opencensus.implcore.metrics.LongGaugeImpl
- All Implemented Interfaces:
Meter
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class LongGauge
LongGauge.LongPoint -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<LabelValue> private final List<LabelValue> private final intprivate final MetricDescriptorprivate Map<List<LabelValue>, LongGaugeImpl.PointImpl> (package private) static final LabelValue -
Constructor Summary
ConstructorsConstructorDescriptionLongGaugeImpl(String name, String description, String unit, List<LabelKey> labelKeys, Map<LabelKey, LabelValue> constantLabels) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes allTimeSeriesfrom the gauge metric.Returns aLongPointfor a gauge with all labels not set, or default labels.Provides aMetricwith one or moreTimeSeries.Provides aMetricDescriptor.getOrCreateTimeSeries(List<LabelValue> labelValues) Creates aTimeSeriesand returns aLongPointif the specifiedlabelValuesis not already associated with this gauge, else returns an existingLongPoint.private LongGauge.LongPointregisterTimeSeries(List<LabelValue> labelValues) voidremoveTimeSeries(List<LabelValue> labelValues) Removes theTimeSeriesfrom the gauge metric, if it is present.
-
Field Details
-
UNSET_VALUE
-
metricDescriptor
-
registeredPoints
-
labelKeysSize
private final int labelKeysSize -
defaultLabelValues
-
constantLabelValues
-
-
Constructor Details
-
LongGaugeImpl
-
-
Method Details
-
getOrCreateTimeSeries
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(String, String, String, List).- Returns:
- a
LongPointthe value of single gauge.
-
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
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.
-
clear
-
getMetricDescriptor
Description copied from interface:MeterProvides aMetricDescriptor.- Specified by:
getMetricDescriptorin interfaceMeter- Returns:
- a
MetricDescriptor.
-
registerTimeSeries
-
getMetric
-