MediaWiki  REL1_22
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 ()
 sendDeltasMemc (array $deltas)
 sendDeltasUDP (array $deltas)

Protected Attributes

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 ( ) [protected]

Definition at line 41 of file StatCounter.php.


Member Function Documentation

Flush all pending deltas to persistent storage.

Returns:
void

Definition at line 74 of file StatCounter.php.

StatCounter::incr ( key,
count = 1 
)

Increment a key by delta $count.

Parameters:
string$key
integer$count
Returns:
void

Definition at line 61 of file StatCounter.php.

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

Definition at line 139 of file StatCounter.php.

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

Definition at line 92 of file StatCounter.php.

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

Definition at line 46 of file StatCounter.php.

Referenced by wfIncrStats(), and wfLogProfilingData().


Member Data Documentation

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

*

Definition at line 39 of file StatCounter.php.


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