MediaWiki  1.30.0
NullStatsdDataFactory Class Reference
Inheritance diagram for NullStatsdDataFactory:
Collaboration diagram for NullStatsdDataFactory:

Public Member Functions

 decrement ( $key)
 This function creates a 'decrement' StatsdData object. More...
 
 gauge ( $key, $value)
 This function creates a 'gauge' StatsdData. More...
 
 getData ()
 Return data from the factory. More...
 
 hasData ()
 Check whether this data factory has any data. More...
 
 increment ( $key)
 This function creates a 'increment' StatsdData object. More...
 
 produceStatsdData ( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
 Produce a StatsdDataInterface Object. More...
 
 set ( $key, $value)
 This function creates a 'set' StatsdData object A "Set" is a count of unique events. More...
 
 setEnabled ( $enabled)
 Set collection enable status. More...
 
 timing ( $key, $time)
 This function creates a 'timing' StatsdData. More...
 
 updateCount ( $key, $delta)
 This function creates a 'updateCount' StatsdData object. More...
 

Detailed Description

Author
Addshore
Since
1.27

Definition at line 11 of file NullStatsdDataFactory.php.

Member Function Documentation

◆ decrement()

NullStatsdDataFactory::decrement (   $key)

This function creates a 'decrement' StatsdData object.

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

Definition at line 71 of file NullStatsdDataFactory.php.

◆ gauge()

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 28 of file NullStatsdDataFactory.php.

◆ getData()

NullStatsdDataFactory::getData ( )

Return data from the factory.

Returns
StatsdData[]

Implements IBufferingStatsdDataFactory.

Definition at line 121 of file NullStatsdDataFactory.php.

◆ hasData()

NullStatsdDataFactory::hasData ( )

Check whether this data factory has any data.

Returns
bool

Implements IBufferingStatsdDataFactory.

Definition at line 113 of file NullStatsdDataFactory.php.

◆ increment()

NullStatsdDataFactory::increment (   $key)

This function creates a 'increment' StatsdData object.

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

Definition at line 59 of file NullStatsdDataFactory.php.

◆ produceStatsdData()

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 97 of file NullStatsdDataFactory.php.

References $value.

◆ set()

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 48 of file NullStatsdDataFactory.php.

◆ setEnabled()

NullStatsdDataFactory::setEnabled (   $enabled)

Set collection enable status.

Parameters
bool$enabledWill collection be enabled?
Returns
void

Implements IBufferingStatsdDataFactory.

Definition at line 130 of file NullStatsdDataFactory.php.

◆ timing()

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 19 of file NullStatsdDataFactory.php.

◆ updateCount()

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 83 of file NullStatsdDataFactory.php.


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