Measure
abstract class Measure
Measure represents a single numeric value to be tracked and recorded.
For example, latency, request bytes, and response bytes could be measures to collect from a server.
Measures by themselves have no outside effects. In order to be exported, the measure needs to be used in a View. If no Views are defined over a measure, there is very little cost in recording it.
Traits
Constants
DIMENSIONLESS |
measurement is dimensionless |
BYTES |
measurement in bytes |
MILLISECONDS |
measurement in milliseconds |
NAME_MAX_LENGTH |
|
EX_NAME_EXISTS |
|
EX_INVALID_NAME |
|
Properties
static protected array | $map | Contains our initialized Measure's | |
protected string | $name | Holds our Measure's name. | |
protected string | $description | Holds our measure's human readable description. | |
protected string | $unit | Holds the unit type of the value this measure takes on. |
Methods
Name returns the name of this measure.
Discription returns the human-readable description of this measure.
Unit returns the units for the values this measure takes on.
Constructs a new IntMeasure.
Constructs a new FloatMeasure.
Details
at line 94
string
getName()
Name returns the name of this measure.
Measure names are globally unique (among all libraries linked into your program). We recommend prefixing the measure name with a domain name relevant to your project or application.
Measure names are never exported to backends. They are only used to create Views.
at line 104
string
getDescription()
Discription returns the human-readable description of this measure.
at line 117
string
getUnit()
Unit returns the units for the values this measure takes on.
Units are encoded according to the case-sensitive abbreviations from the Unified Code for Units of Measure.
at line 132
static IntMeasure
newIntMeasure(string $name, string $description, string $unit)
Constructs a new IntMeasure.
at line 147
static FloatMeasure
newFloatMeasure(string $name, string $description, string $unit)
Constructs a new FloatMeasure.