Class MeasureMap

java.lang.Object
io.opencensus.stats.MeasureMap
Direct Known Subclasses:
MeasureMapImpl, NoopStats.NoopMeasureMap

@NotThreadSafe public abstract class MeasureMap extends Object
A map from Measures to measured values to be recorded at the same time.
Since:
0.8
  • Constructor Details

    • MeasureMap

      public MeasureMap()
  • Method Details

    • put

      public abstract MeasureMap put(Measure.MeasureDouble measure, double value)
      Associates the Measure.MeasureDouble with the given value. Subsequent updates to the same Measure.MeasureDouble will overwrite the previous value.
      Parameters:
      measure - the Measure.MeasureDouble
      value - the value to be associated with measure
      Returns:
      this
      Since:
      0.8
    • put

      public abstract MeasureMap put(Measure.MeasureLong measure, long value)
      Associates the Measure.MeasureLong with the given value. Subsequent updates to the same Measure.MeasureLong will overwrite the previous value.
      Parameters:
      measure - the Measure.MeasureLong
      value - the value to be associated with measure
      Returns:
      this
      Since:
      0.8
    • putAttachment

      @Deprecated public MeasureMap putAttachment(String key, String value)
      Deprecated.
      Associate the contextual information of an Exemplar to this MeasureMap. Contextual information is represented as String 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 an Exemplar.
      value - the string representation of contextual information of an Exemplar.
      Returns:
      this
      Since:
      0.16
    • putAttachment

      public MeasureMap putAttachment(String key, AttachmentValue value)
      Associate the contextual information of an Exemplar to this MeasureMap. Contextual information is represented as a String key and an AttachmentValue.

      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 an Exemplar.
      value - the value of contextual information of an Exemplar.
      Returns:
      this
      Since:
      0.20
    • record

      public abstract void record()
      Records all of the measures at the same time, with the current TagContext.

      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 explicit TagContext.

      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