Package io.opencensus.stats
Class Measure
- java.lang.Object
-
- io.opencensus.stats.Measure
-
- Direct Known Subclasses:
Measure.MeasureDouble,Measure.MeasureLong
@Immutable public abstract class Measure extends java.lang.ObjectThe definition of theMeasurementthat is taken by OpenCensus library.- Since:
- 0.8
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMeasure.MeasureDoubleMeasurewithDoubletyped values.static classMeasure.MeasureLongMeasurewithLongtyped values.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringERROR_MESSAGE_INVALID_NAME(package private) static intNAME_MAX_LENGTH
-
Constructor Summary
Constructors Modifier Constructor Description privateMeasure()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.StringgetDescription()Detailed description of the measure, used in documentation.abstract java.lang.StringgetName()Name of measure, as aString.abstract java.lang.StringgetUnit()The units in whichMeasurevalues are measured.abstract <T> Tmatch(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.
-
-
-
Field Detail
-
NAME_MAX_LENGTH
static final int NAME_MAX_LENGTH
- See Also:
- Constant Field Values
-
ERROR_MESSAGE_INVALID_NAME
private static final java.lang.String ERROR_MESSAGE_INVALID_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 java.lang.String getName()
Name of measure, as aString. 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 java.lang.String getDescription()
Detailed description of the measure, used in documentation.- Since:
- 0.8
-
getUnit
public abstract java.lang.String getUnit()
The units in whichMeasurevalues 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
-
-