Stud.IP
5.4
|
Static Public Member Functions | |
static | count ($stat, $increment, $sampleRate=1) |
static | increment ($stat, $sampleRate=1) |
static | decrement ($stat, $sampleRate=1) |
static | gauge ($stat, $value, $sampleRate=1) |
static | timing ($stat, $milliseconds, $sampleRate=1) |
static | startTimer () |
Front-end proxy to a metrics collection service provided by installed MetricsPlugins.
Send metrics to the metrics collection service using gauges, counters or timers (depending on the type of stat you want to measure):
Please note: Names of stats must be strings containing lowercase characters or underscores. You may use .
(dots) to namespace them. Metrics send from Stud.IP core code should start with 'core.' for example 'core.request_time'.
|
static |
Increment a counter.
string | $stat | the name of the counter |
integer | $increment | the amount to increment by; must be within [-2^63, 2^63] |
float | $sampleRate | a float between 0 and 1; will only be send this percentage of time |
|
static |
Increment a counter by -1.
string | $stat | the name of the counter |
float | $sampleRate | a float between 0 and 1; will only be send this percentage of time |
|
static |
Set a gauge value.
string | $stat | the name of the gauge |
integer | $value | the value of the gauge; must be within [0, 2^64] |
float | $sampleRate | a float between 0 and 1; will only be send this percentage of time |
|
static |
Increment a counter by +1.
string | $stat | the name of the counter |
float | $sampleRate | a float between 0 and 1; will only be send this percentage of time |
|
static |
Return a timer function that you may invoke to send the recorded time between calling Metrics::startTimer and calling its resulting timer.
The timer function has this signature:
Invoke the timer function using a stat name and an optional sample rate:
|
static |
Record a timing.
string | $stat | the name of the counter |
integer | $milliseconds | the amount to milliseconds that something lastedincrement by; must be within [0, 2^64] |
float | $sampleRate | a float between 0 and 1; will only be send this percentage of time |