Package io.opencensus.stats
Class MeasureMap
- java.lang.Object
-
- io.opencensus.stats.MeasureMap
-
- Direct Known Subclasses:
MeasureMapImpl
,NoopStats.NoopMeasureMap
@NotThreadSafe public abstract class MeasureMap extends java.lang.Object
A map fromMeasure
s to measured values to be recorded at the same time.- Since:
- 0.8
-
-
Constructor Summary
Constructors Constructor Description MeasureMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract 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.MeasureMap
putAttachment(java.lang.String key, AttachmentValue value)
Associate the contextual information of anExemplar
to thisMeasureMap
.MeasureMap
putAttachment(java.lang.String key, java.lang.String value)
Deprecated.in favor ofputAttachment(String, AttachmentValue)
.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
.
-
-
-
Method Detail
-
put
public abstract MeasureMap put(Measure.MeasureDouble measure, double value)
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
public abstract MeasureMap put(Measure.MeasureLong measure, long value)
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 public MeasureMap putAttachment(java.lang.String key, java.lang.String value)
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
public MeasureMap putAttachment(java.lang.String key, AttachmentValue value)
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
public abstract void record(TagContext tags)
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
-
-