MediaWiki master
|
MediaWiki's adaption of StatsdDataFactory that provides buffering and metric prefixing. More...
Inherits StatsdDataFactory, and Wikimedia\Stats\IBufferingStatsdDataFactory.
Public Member Functions | |
__construct ( $prefix) | |
clearData () | |
Clear all buffered data from the factory. | |
decrement ( $key) | |
gauge ( $key, $value) | |
getData () | |
getDataCount () | |
Return the number of buffered statsd data entries. | |
hasData () | |
Check whether this data factory has any buffered data. | |
increment ( $key) | |
produceStatsdData ( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT) | |
set ( $key, $value) | |
setEnabled ( $enabled) | |
Set collection enable status. | |
timing ( $key, $time) | |
updateCount ( $key, $delta) | |
Protected Attributes | |
array | $buffer = [] |
bool | $enabled = true |
MediaWiki's adaption of StatsdDataFactory that provides buffering and metric prefixing.
The buffering functionality exists as a performance optimisation to reduce network traffic and StatsD processing by maximally utilizing StatsdClient's ability to compress counter increments, and send all data in a few large UDP packets over a single connection.
These buffers are sent from MediaWikiEntryPoint::emitBufferedStats. For web requests, this happens post-send. For command-line scripts, this happens periodically from a database callback (see MWLBFactory::applyGlobalState).
Definition at line 49 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::__construct | ( | $prefix | ) |
Definition at line 57 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::clearData | ( | ) |
Clear all buffered data from the factory.
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 206 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::decrement | ( | $key | ) |
Wikimedia\Stats\BufferingStatsdDataFactory::gauge | ( | $key, | |
$value ) |
string | $key | |
float | int | $value |
Definition at line 83 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::getData | ( | ) |
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 190 of file BufferingStatsdDataFactory.php.
References Wikimedia\Stats\BufferingStatsdDataFactory\produceStatsdData().
Wikimedia\Stats\BufferingStatsdDataFactory::getDataCount | ( | ) |
Return the number of buffered statsd data entries.
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 210 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::hasData | ( | ) |
Check whether this data factory has any buffered data.
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 182 of file BufferingStatsdDataFactory.php.
References Wikimedia\Stats\BufferingStatsdDataFactory\$buffer.
Wikimedia\Stats\BufferingStatsdDataFactory::increment | ( | $key | ) |
Wikimedia\Stats\BufferingStatsdDataFactory::produceStatsdData | ( | $key, | |
$value = 1, | |||
$metric = StatsdDataInterface::STATSD_METRIC_COUNT ) |
Definition at line 161 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\getData().
Wikimedia\Stats\BufferingStatsdDataFactory::set | ( | $key, | |
$value ) |
string | $key | |
float | int | $value |
Definition at line 95 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::setEnabled | ( | $enabled | ) |
Set collection enable status.
bool | $enabled | Will collection be enabled? |
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 214 of file BufferingStatsdDataFactory.php.
References Wikimedia\Stats\BufferingStatsdDataFactory\$enabled.
Wikimedia\Stats\BufferingStatsdDataFactory::timing | ( | $key, | |
$time ) |
string | $key | |
float | int | $time |
Definition at line 71 of file BufferingStatsdDataFactory.php.
Wikimedia\Stats\BufferingStatsdDataFactory::updateCount | ( | $key, | |
$delta ) |
string | $key | |
int | $delta |
Definition at line 131 of file BufferingStatsdDataFactory.php.
|
protected |
Definition at line 51 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\hasData().
|
protected |
Definition at line 53 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\setEnabled().