MediaWiki  REL1_24
StatCounter Class Reference

Aggregator for wfIncrStats() that batches updates per request. More...

Collaboration diagram for StatCounter:

List of all members.

Public Member Functions

 flush ()
 Flush all pending deltas to persistent storage.
 incr ($key, $count=1)
 Increment a key by delta $count.

Static Public Member Functions

static singleton ()

Protected Member Functions

 __construct (Config $config)
 sendDeltasMemc (array $deltas)
 sendDeltasUDP (array $deltas)

Protected Attributes

Config $config
 *
array $deltas = array()
 *

Detailed Description

Aggregator for wfIncrStats() that batches updates per request.

This avoids spamming the collector many times for the same key.

Definition at line 38 of file StatCounter.php.


Constructor & Destructor Documentation

StatCounter::__construct ( Config config) [protected]

Definition at line 43 of file StatCounter.php.

References $config.


Member Function Documentation

Flush all pending deltas to persistent storage.

Returns:
void

Definition at line 80 of file StatCounter.php.

StatCounter::incr ( key,
count = 1 
)

Increment a key by delta $count.

Parameters:
string$key
int$count
Returns:
void

Definition at line 67 of file StatCounter.php.

StatCounter::sendDeltasMemc ( array deltas) [protected]
Parameters:
array$deltas
Returns:
void

Definition at line 142 of file StatCounter.php.

StatCounter::sendDeltasUDP ( array deltas) [protected]
Parameters:
array$deltas
Returns:
void

Definition at line 97 of file StatCounter.php.

static StatCounter::singleton ( ) [static]
Returns:
StatCounter

Definition at line 50 of file StatCounter.php.

Referenced by wfIncrStats(), and wfLogProfilingData().


Member Data Documentation

Config StatCounter::$config [protected]

*

Definition at line 41 of file StatCounter.php.

Referenced by __construct().

array StatCounter::$deltas = array() [protected]

*

Definition at line 39 of file StatCounter.php.


The documentation for this class was generated from the following file: