class IntMeasure extends Measure

IntMeasure is a Measure for Int values.

Traits

Internal utility methods for working with tag keys, tag values, and metric names.
Trait which handles Measure creation. Takes care of name validation and deduplication.
Internal utility methods for working with tag keys, tag values, and metric names.

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 from Measure
protected string $name Holds our Measure's name. from Measure
protected string $description Holds our measure's human readable description. from Measure
protected string $unit Holds the unit type of the value this measure takes on. from Measure

Methods

string
getName()

Name returns the name of this measure.

from Measure
string
getDescription()

Discription returns the human-readable description of this measure.

from Measure
string
getUnit()

Unit returns the units for the values this measure takes on.

from Measure
static IntMeasure
newIntMeasure(string $name, string $description, string $unit)

Constructs a new IntMeasure.

from Measure
static FloatMeasure
newFloatMeasure(string $name, string $description, string $unit)

Constructs a new FloatMeasure.

from Measure
static IntMeasure
create(string $name, string $description = "", string $unit = Measure::DIMENSIONLESS)

Constructs a new IntMeasure.

m(int $value)

Creates a Measurement of provided value.

Details

in Measure 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.

Return Value

string

in Measure at line 104
string getDescription()

Discription returns the human-readable description of this measure.

Return Value

string

in 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.

Return Value

string

in Measure at line 132
static IntMeasure newIntMeasure(string $name, string $description, string $unit)

Constructs a new IntMeasure.

Parameters

string $name Unique name of the Measure.
string $description Human readable discription of the Measure.
string $unit Unit of the Measure. See Unified Code for Units of Measure

Return Value

IntMeasure

Exceptions

Exception Throws on invalid measure name.

in Measure at line 147
static FloatMeasure newFloatMeasure(string $name, string $description, string $unit)

Constructs a new FloatMeasure.

Parameters

string $name Unique name of the Measure.
string $description Human readable discription of the Measure.
string $unit Unit of the Measure. See Unified Code for Units of Measure

Return Value

FloatMeasure

Exceptions

Exception Throws on invalid measure name.

at line 51
final static IntMeasure create(string $name, string $description = "", string $unit = Measure::DIMENSIONLESS)

Constructs a new IntMeasure.

Parameters

string $name Unique name of the Measure.
string $description Human readable discription of the Measure.
string $unit Unit of the Measure. See Unified Code for Units of Measure

Return Value

IntMeasure

Exceptions

Exception Throws on invalid measure name.

at line 65
final Measurement m(int $value)

Creates a Measurement of provided value.

Parameters

int $value the measurement value.

Return Value

Measurement Returns a Measurement object which can be recorded.