Class Measure

java.lang.Object
io.opencensus.stats.Measure
Direct Known Subclasses:
Measure.MeasureDouble, Measure.MeasureLong

@Immutable public abstract class Measure extends Object
The definition of the Measurement that is taken by OpenCensus library.
Since:
0.8
  • Field Details

  • Constructor Details

    • Measure

      private Measure()
  • Method Details

    • match

      public abstract <T> T match(Function<? super Measure.MeasureDouble,T> p0, Function<? super Measure.MeasureLong,T> p1, Function<? super Measure,T> defaultFunction)
      Applies the given match function to the underlying data type.
      Since:
      0.8
    • getName

      public abstract String getName()
      Name of measure, as a String. Should be a ASCII string with a length no greater than 255 characters.

      Suggested format for name: <web_host>/<path>.

      Since:
      0.8
    • getDescription

      public abstract String getDescription()
      Detailed description of the measure, used in documentation.
      Since:
      0.8
    • getUnit

      public abstract String getUnit()
      The units in which Measure values are measured.

      The suggested grammar for a unit is as follows:

      • Expression = Component { "." Component } {"/" Component };
      • Component = [ PREFIX ] UNIT [ Annotation ] | Annotation | "1";
      • Annotation = "{" NAME "}" ;

      For example, string “MBy{transmitted}/ms” stands for megabytes per milliseconds, and the annotation transmitted inside {} is just a comment of the unit.

      Since:
      0.8