MediaWiki REL1_40
|
Writers gather a batch of increment operations and then commit them when flush() is called, or when the writer is destroyed. More...
Public Member Functions | |
__construct (StatsStore $store, $specs, $prefix) | |
__destruct () | |
Commit the batch of increment operations. | |
flush () | |
Commit the batch of increment operations. | |
incr ( $name, ?EntityKey $entity=null, $value=1) | |
Queue an increment operation. | |
resetAll (?array $entities=null) | |
Delete all stored metrics corresponding to the specs supplied to the constructor, resetting the counters to zero. | |
resetCurrentTime () | |
Reset the stored current time. | |
setCurrentTime ( $now) | |
Set the time to be used as the current time. | |
Writers gather a batch of increment operations and then commit them when flush() is called, or when the writer is destroyed.
Definition at line 11 of file WRStatsWriter.php.
Wikimedia\WRStats\WRStatsWriter::__construct | ( | StatsStore | $store, |
$specs, | |||
$prefix ) |
StatsStore | $store | |
array | $specs | |
string | string[] | $prefix |
Definition at line 30 of file WRStatsWriter.php.
Wikimedia\WRStats\WRStatsWriter::__destruct | ( | ) |
Commit the batch of increment operations.
Definition at line 117 of file WRStatsWriter.php.
References Wikimedia\WRStats\WRStatsWriter\flush().
Wikimedia\WRStats\WRStatsWriter::flush | ( | ) |
Commit the batch of increment operations.
Definition at line 107 of file WRStatsWriter.php.
Referenced by Wikimedia\WRStats\WRStatsWriter\__destruct().
Wikimedia\WRStats\WRStatsWriter::incr | ( | $name, | |
?EntityKey | $entity = null, | ||
$value = 1 ) |
Queue an increment operation.
string | $name | The metric name |
EntityKey | null | $entity | Additional storage key components |
float | int | $value | The value to add |
Definition at line 50 of file WRStatsWriter.php.
References $res.
Wikimedia\WRStats\WRStatsWriter::resetAll | ( | ?array | $entities = null | ) |
Delete all stored metrics corresponding to the specs supplied to the constructor, resetting the counters to zero.
EntityKey[] | null | $entities | An array of additional storage key components. The default is the empty local entity. |
Definition at line 128 of file WRStatsWriter.php.
References $keys.
Wikimedia\WRStats\WRStatsWriter::resetCurrentTime | ( | ) |
Reset the stored current time.
In a long-running process this should be called regularly to write new results.
Definition at line 92 of file WRStatsWriter.php.
Wikimedia\WRStats\WRStatsWriter::setCurrentTime | ( | $now | ) |
Set the time to be used as the current time.
float | int | $now |
Definition at line 82 of file WRStatsWriter.php.