Class Measure
java.lang.Object
io.opencensus.stats.Measure
- Direct Known Subclasses:
Measure.MeasureDouble, Measure.MeasureLong
The definition of the
Measurement that is taken by OpenCensus library.- Since:
- 0.8
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringDetailed description of the measure, used in documentation.abstract StringgetName()Name of measure, as aString.abstract 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 Details
-
NAME_MAX_LENGTH
static final int NAME_MAX_LENGTH- See Also:
-
ERROR_MESSAGE_INVALID_NAME
- See Also:
-
-
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
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
Detailed description of the measure, used in documentation.- Since:
- 0.8
-
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
-