Package io.opencensus.implcore.metrics
Class LongGaugeImpl
java.lang.Object
io.opencensus.metrics.LongGauge
io.opencensus.implcore.metrics.LongGaugeImpl
- All Implemented Interfaces:
Meter
Implementation of
LongGauge
.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.opencensus.metrics.LongGauge
LongGauge.LongPoint
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<LabelValue> private final List
<LabelValue> private final int
private final MetricDescriptor
private 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 TypeMethodDescriptionvoid
clear()
Removes allTimeSeries
from the gauge metric.Returns aLongPoint
for a gauge with all labels not set, or default labels.Provides aMetric
with one or moreTimeSeries
.Provides aMetricDescriptor
.getOrCreateTimeSeries
(List<LabelValue> labelValues) Creates aTimeSeries
and returns aLongPoint
if the specifiedlabelValues
is not already associated with this gauge, else returns an existingLongPoint
.private LongGauge.LongPoint
registerTimeSeries
(List<LabelValue> labelValues) void
removeTimeSeries
(List<LabelValue> labelValues) Removes theTimeSeries
from 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: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). -
getMetricDescriptor
Description copied from interface:Meter
Provides aMetricDescriptor
.- Specified by:
getMetricDescriptor
in interfaceMeter
- Returns:
- a
MetricDescriptor
.
-
registerTimeSeries
-
getMetric
Description copied from interface:Meter
Provides aMetric
with one or moreTimeSeries
.
-