MediaWiki REL1_40
|
MediaWiki adaption of StatsdDataFactory that provides buffering and metric prefixing. More...
Inherits StatsdDataFactory, and 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 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 MediaWiki::emitBufferedStatsdData. For web requests, this happens post-send. For command-line scripts, this happens periodically from a database callback (see MWLBFactory::applyGlobalState).
Definition at line 47 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::__construct | ( | $prefix | ) |
Definition at line 55 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::clearData | ( | ) |
Clear all buffered data from the factory.
Implements IBufferingStatsdDataFactory.
Definition at line 204 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::decrement | ( | $key | ) |
BufferingStatsdDataFactory::gauge | ( | $key, | |
$value ) |
string | $key | |
float | int | $value |
Definition at line 81 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::getData | ( | ) |
Implements IBufferingStatsdDataFactory.
Definition at line 188 of file BufferingStatsdDataFactory.php.
References produceStatsdData().
BufferingStatsdDataFactory::getDataCount | ( | ) |
Return the number of buffered statsd data entries.
Implements IBufferingStatsdDataFactory.
Definition at line 208 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::hasData | ( | ) |
Check whether this data factory has any buffered data.
Implements IBufferingStatsdDataFactory.
Definition at line 180 of file BufferingStatsdDataFactory.php.
References $buffer.
BufferingStatsdDataFactory::increment | ( | $key | ) |
BufferingStatsdDataFactory::produceStatsdData | ( | $key, | |
$value = 1, | |||
$metric = StatsdDataInterface::STATSD_METRIC_COUNT ) |
Definition at line 159 of file BufferingStatsdDataFactory.php.
Referenced by getData().
BufferingStatsdDataFactory::set | ( | $key, | |
$value ) |
string | $key | |
float | int | $value |
Definition at line 93 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::setEnabled | ( | $enabled | ) |
Set collection enable status.
bool | $enabled | Will collection be enabled? |
Implements IBufferingStatsdDataFactory.
Definition at line 212 of file BufferingStatsdDataFactory.php.
References $enabled.
BufferingStatsdDataFactory::timing | ( | $key, | |
$time ) |
string | $key | |
float | int | $time |
Definition at line 69 of file BufferingStatsdDataFactory.php.
BufferingStatsdDataFactory::updateCount | ( | $key, | |
$delta ) |
string | $key | |
int | $delta |
Definition at line 129 of file BufferingStatsdDataFactory.php.
|
protected |
Definition at line 49 of file BufferingStatsdDataFactory.php.
Referenced by hasData().
|
protected |
Definition at line 51 of file BufferingStatsdDataFactory.php.
Referenced by setEnabled().