MediaWiki REL1_33
|
A statsd client that applies the sampling rate to the data items before sending them. More...
Public Member Functions | |
appendSampleRate ( $data, $sampleRate=1) | |
Sets sampling rate for all items in $data. | |
send ( $data, $sampleRate=1) | |
Send the metrics over UDP Sample the metrics according to their sample rate and send the remaining ones. | |
setSamplingRates (array $samplingRates) | |
Sampling rates as an associative array of patterns and rates. | |
Protected Member Functions | |
sampleData ( $data) | |
Throw away some of the data according to the sample rate. | |
throwException (Exception $exception) | |
@inheritDoc | |
Protected Attributes | |
$samplingRates = [] | |
A statsd client that applies the sampling rate to the data items before sending them.
Definition at line 32 of file SamplingStatsdClient.php.
SamplingStatsdClient::appendSampleRate | ( | $data, | |
$sampleRate = 1 ) |
Sets sampling rate for all items in $data.
The sample rate specified in a StatsdData entity overrides the sample rate specified here.
@inheritDoc
Definition at line 52 of file SamplingStatsdClient.php.
References $data, $samplingRates, and and().
Referenced by send().
|
protected |
Throw away some of the data according to the sample rate.
StatsdDataInterface[] | $data |
LogicException |
Definition at line 131 of file SamplingStatsdClient.php.
Referenced by send().
SamplingStatsdClient::send | ( | $data, | |
$sampleRate = 1 ) |
Send the metrics over UDP Sample the metrics according to their sample rate and send the remaining ones.
StatsdDataInterface | StatsdDataInterface[] | $data | message(s) to sent strings are not allowed here as sampleData requires a StatsdDataInterface |
int | $sampleRate |
Definition at line 82 of file SamplingStatsdClient.php.
References $data, $e, and(), appendSampleRate(), sampleData(), and throwException().
SamplingStatsdClient::setSamplingRates | ( | array | $samplingRates | ) |
Sampling rates as an associative array of patterns and rates.
Patterns are Unix shell patterns (e.g. 'MediaWiki.api.*'). Rates are sampling probabilities (e.g. 0.1 means 1 in 10 events are sampled).
array | $samplingRates |
Definition at line 42 of file SamplingStatsdClient.php.
References $samplingRates.
|
protected |
@inheritDoc
Definition at line 152 of file SamplingStatsdClient.php.
References and().
Referenced by send().
|
protected |
Definition at line 33 of file SamplingStatsdClient.php.
Referenced by appendSampleRate(), and setSamplingRates().