Package io.opencensus.stats
Class MeasureMap
java.lang.Object
io.opencensus.stats.MeasureMap
- Direct Known Subclasses:
MeasureMapImpl
,NoopStats.NoopMeasureMap
A map from
Measure
s to measured values to be recorded at the same time.- Since:
- 0.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract MeasureMap
put
(Measure.MeasureDouble measure, double value) Associates theMeasure.MeasureDouble
with the given value.abstract MeasureMap
put
(Measure.MeasureLong measure, long value) Associates theMeasure.MeasureLong
with the given value.putAttachment
(String key, AttachmentValue value) Associate the contextual information of anExemplar
to thisMeasureMap
.putAttachment
(String key, String value) Deprecated.abstract void
record()
Records all of the measures at the same time, with the currentTagContext
.abstract void
record
(TagContext tags) Records all of the measures at the same time, with an explicitTagContext
.
-
Constructor Details
-
MeasureMap
public MeasureMap()
-
-
Method Details
-
put
Associates theMeasure.MeasureDouble
with the given value. Subsequent updates to the sameMeasure.MeasureDouble
will overwrite the previous value.- Parameters:
measure
- theMeasure.MeasureDouble
value
- the value to be associated withmeasure
- Returns:
- this
- Since:
- 0.8
-
put
Associates theMeasure.MeasureLong
with the given value. Subsequent updates to the sameMeasure.MeasureLong
will overwrite the previous value.- Parameters:
measure
- theMeasure.MeasureLong
value
- the value to be associated withmeasure
- Returns:
- this
- Since:
- 0.8
-
putAttachment
Deprecated.in favor ofputAttachment(String, AttachmentValue)
.Associate the contextual information of anExemplar
to thisMeasureMap
. Contextual information is represented asString
key-value pairs.If this method is called multiple times with the same key, only the last value will be kept.
- Parameters:
key
- the key of contextual information of anExemplar
.value
- the string representation of contextual information of anExemplar
.- Returns:
- this
- Since:
- 0.16
-
putAttachment
Associate the contextual information of anExemplar
to thisMeasureMap
. Contextual information is represented as aString
key and anAttachmentValue
.If this method is called multiple times with the same key, only the last value will be kept.
- Parameters:
key
- the key of contextual information of anExemplar
.value
- the value of contextual information of anExemplar
.- Returns:
- this
- Since:
- 0.20
-
record
public abstract void record()Records all of the measures at the same time, with the currentTagContext
.This method records all of the stats in the
MeasureMap
every time it is called.- Since:
- 0.8
-
record
Records all of the measures at the same time, with an explicitTagContext
.This method records all of the stats in the
MeasureMap
every time it is called.- Parameters:
tags
- the tags associated with the measurements.- Since:
- 0.8
-
putAttachment(String, AttachmentValue)
.