MediaWiki master
Wikimedia\Stats\NullStatsdDataFactory Class Reference

Inherits Wikimedia\Stats\IBufferingStatsdDataFactory.

Collaboration diagram for Wikimedia\Stats\NullStatsdDataFactory:

Public Member Functions

 clearData ()
 Clear all buffered data from the factory.
 
 decrement ( $key)
 This function creates a 'decrement' StatsdData object.
 
 gauge ( $key, $value)
 This function creates a 'gauge' StatsdData.
 
 getData ()
 Return the buffered data from the factory.
Returns
StatsdData[]

 
 getDataCount ()
 Return the number of buffered statsd data entries.
Returns
int
Since
1.31

 
 hasData ()
 Check whether this data factory has any buffered data.
Returns
bool

 
 increment ( $key)
 This function creates a 'increment' StatsdData object.
 
 produceStatsdData ( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
 Produce a StatsdDataInterface Object.
 
 set ( $key, $value)
 This function creates a 'set' StatsdData object A "Set" is a count of unique events.
 
 setEnabled ( $enabled)
 Set collection enable status.
Parameters
bool$enabledWill collection be enabled?
Returns
void

 
 timing ( $key, $time)
 This function creates a 'timing' StatsdData.
 
 updateCount ( $key, $delta)
 This function creates a 'updateCount' StatsdData object.
 

Detailed Description

Author
Addshore
Deprecated
since 1.45, use StatsFactory::newNull() instead
Since
1.27

Definition at line 13 of file NullStatsdDataFactory.php.

Member Function Documentation

◆ clearData()

Wikimedia\Stats\NullStatsdDataFactory::clearData ( )

Clear all buffered data from the factory.

Since
1.31

Implements Wikimedia\Stats\IBufferingStatsdDataFactory.

Definition at line 121 of file NullStatsdDataFactory.php.

◆ decrement()

Wikimedia\Stats\NullStatsdDataFactory::decrement ( $key)

This function creates a 'decrement' StatsdData object.

Parameters
string | array$keyThe metric(s) to decrement.
Returns
mixed

Definition at line 73 of file NullStatsdDataFactory.php.

◆ gauge()

Wikimedia\Stats\NullStatsdDataFactory::gauge ( $key,
$value )

This function creates a 'gauge' StatsdData.

Parameters
string | array$keyThe metric(s) to set.
float$valueThe value for the stats.

Definition at line 30 of file NullStatsdDataFactory.php.

◆ getData()

Wikimedia\Stats\NullStatsdDataFactory::getData ( )

Return the buffered data from the factory.

Returns
StatsdData[]

Implements Wikimedia\Stats\IBufferingStatsdDataFactory.

Definition at line 117 of file NullStatsdDataFactory.php.

◆ getDataCount()

Wikimedia\Stats\NullStatsdDataFactory::getDataCount ( )

Return the number of buffered statsd data entries.

Returns
int
Since
1.31

Implements Wikimedia\Stats\IBufferingStatsdDataFactory.

Definition at line 126 of file NullStatsdDataFactory.php.

◆ hasData()

Wikimedia\Stats\NullStatsdDataFactory::hasData ( )

Check whether this data factory has any buffered data.

Returns
bool

Implements Wikimedia\Stats\IBufferingStatsdDataFactory.

Definition at line 112 of file NullStatsdDataFactory.php.

◆ increment()

Wikimedia\Stats\NullStatsdDataFactory::increment ( $key)

This function creates a 'increment' StatsdData object.

Parameters
string | array$keyThe metric(s) to increment.
Returns
array

Definition at line 61 of file NullStatsdDataFactory.php.

◆ produceStatsdData()

Wikimedia\Stats\NullStatsdDataFactory::produceStatsdData ( $key,
$value = 1,
$metric = StatsdDataInterface::STATSD_METRIC_COUNT )

Produce a StatsdDataInterface Object.

Parameters
string$keyThe key of the metric
int$valueThe amount to increment/decrement each metric by.
string$metricThe metric type ("c" for count, "ms" for timing, "g" for gauge, "s" for set)
Returns
StatsdDataInterface

Definition at line 99 of file NullStatsdDataFactory.php.

◆ set()

Wikimedia\Stats\NullStatsdDataFactory::set ( $key,
$value )

This function creates a 'set' StatsdData object A "Set" is a count of unique events.

This data type acts like a counter, but supports counting of unique occurrences of values between flushes. The backend receives the number of unique events that happened since the last flush.

The reference use case involved tracking the number of active and logged in users by sending the current userId of a user with each request with a key of "uniques" (or similar).

Parameters
string | array$keyThe metric(s) to set.
float$valueThe value for the stats.
Returns
array

Definition at line 50 of file NullStatsdDataFactory.php.

◆ setEnabled()

Wikimedia\Stats\NullStatsdDataFactory::setEnabled ( $enabled)

Set collection enable status.

Parameters
bool$enabledWill collection be enabled?
Returns
void

Implements Wikimedia\Stats\IBufferingStatsdDataFactory.

Definition at line 131 of file NullStatsdDataFactory.php.

◆ timing()

Wikimedia\Stats\NullStatsdDataFactory::timing ( $key,
$time )

This function creates a 'timing' StatsdData.

Parameters
string | array$keyThe metric(s) to set.
float$timeThe elapsed time (ms) to log

Definition at line 21 of file NullStatsdDataFactory.php.

◆ updateCount()

Wikimedia\Stats\NullStatsdDataFactory::updateCount ( $key,
$delta )

This function creates a 'updateCount' StatsdData object.

Parameters
string | array$keyThe metric(s) to decrement.
int$deltaThe delta to add to the each metric
Returns
mixed

Definition at line 85 of file NullStatsdDataFactory.php.


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