|
MediaWiki master
|
MediaWiki's adaption of StatsdDataFactory that provides buffering and metric prefixing. More...
Inherits StatsdDataFactory, and Wikimedia\Stats\IBufferingStatsdDataFactory.

Public Member Functions | ||||
| __construct (string $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 calls to Maintenance::commitTransaction() and Maintenance::commitTransactionRound().
Definition at line 36 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::__construct | ( | string | $prefix | ) |
Definition at line 44 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::clearData | ( | ) |
Clear all buffered data from the factory.
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 196 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::decrement | ( | $key | ) |
| Wikimedia\Stats\BufferingStatsdDataFactory::gauge | ( | $key, | |
| $value ) |
| string | $key | |
| float | int | $value |
Definition at line 70 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::getData | ( | ) |
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 179 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 201 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::hasData | ( | ) |
Check whether this data factory has any buffered data.
Implements Wikimedia\Stats\IBufferingStatsdDataFactory.
Definition at line 171 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 149 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\getData().
| Wikimedia\Stats\BufferingStatsdDataFactory::set | ( | $key, | |
| $value ) |
| string | $key | |
| float | int | $value |
Definition at line 82 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 206 of file BufferingStatsdDataFactory.php.
References Wikimedia\Stats\BufferingStatsdDataFactory\$enabled.
| Wikimedia\Stats\BufferingStatsdDataFactory::timing | ( | $key, | |
| $time ) |
| string | $key | |
| float | int | $time |
Definition at line 58 of file BufferingStatsdDataFactory.php.
| Wikimedia\Stats\BufferingStatsdDataFactory::updateCount | ( | $key, | |
| $delta ) |
| string | $key | |
| int | $delta |
Definition at line 118 of file BufferingStatsdDataFactory.php.
|
protected |
Definition at line 38 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\hasData().
|
protected |
Definition at line 40 of file BufferingStatsdDataFactory.php.
Referenced by Wikimedia\Stats\BufferingStatsdDataFactory\setEnabled().