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.ObjectA map fromMeasures 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 MeasureMapput(Measure.MeasureDouble measure, double value)Associates theMeasure.MeasureDoublewith the given value.abstract MeasureMapput(Measure.MeasureLong measure, long value)Associates theMeasure.MeasureLongwith the given value.MeasureMapputAttachment(java.lang.String key, AttachmentValue value)Associate the contextual information of anExemplarto thisMeasureMap.MeasureMapputAttachment(java.lang.String key, java.lang.String value)Deprecated.in favor ofputAttachment(String, AttachmentValue).abstract voidrecord()Records all of the measures at the same time, with the currentTagContext.abstract voidrecord(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.MeasureDoublewith the given value. Subsequent updates to the sameMeasure.MeasureDoublewill overwrite the previous value.- Parameters:
measure- theMeasure.MeasureDoublevalue- the value to be associated withmeasure- Returns:
- this
- Since:
- 0.8
-
put
public abstract MeasureMap put(Measure.MeasureLong measure, long value)
Associates theMeasure.MeasureLongwith the given value. Subsequent updates to the sameMeasure.MeasureLongwill overwrite the previous value.- Parameters:
measure- theMeasure.MeasureLongvalue- 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 anExemplarto thisMeasureMap. Contextual information is represented asStringkey-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 anExemplarto thisMeasureMap. Contextual information is represented as aStringkey 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
MeasureMapevery 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
MeasureMapevery time it is called.- Parameters:
tags- the tags associated with the measurements.- Since:
- 0.8
-
-