|
MediaWiki master
|
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<string,array> | $specs | |
| string | string[] | $prefix |
Definition at line 29 of file WRStatsWriter.php.
| Wikimedia\WRStats\WRStatsWriter::__destruct | ( | ) |
Commit the batch of increment operations.
Definition at line 116 of file WRStatsWriter.php.
References Wikimedia\WRStats\WRStatsWriter\flush().
| Wikimedia\WRStats\WRStatsWriter::flush | ( | ) |
Commit the batch of increment operations.
Definition at line 106 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 49 of file WRStatsWriter.php.
| 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 127 of file WRStatsWriter.php.
| 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 91 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 81 of file WRStatsWriter.php.