MediaWiki  master
NullStatsdDataFactory.php
Go to the documentation of this file.
1 <?php
2 
3 use Liuggio\StatsdClient\Entity\StatsdData;
4 use Liuggio\StatsdClient\Entity\StatsdDataInterface;
5 
11 
18  public function timing( $key, $time ) {
19  }
20 
27  public function gauge( $key, $value ) {
28  }
29 
47  public function set( $key, $value ) {
48  return [];
49  }
50 
58  public function increment( $key ) {
59  return [];
60  }
61 
70  public function decrement( $key ) {
71  return [];
72  }
73 
82  public function updateCount( $key, $delta ) {
83  return [];
84  }
85 
96  public function produceStatsdData(
97  $key,
98  $value = 1,
99  $metric = StatsdDataInterface::STATSD_METRIC_COUNT
100  ) {
101  $data = new StatsdData();
102  $data->setKey( $key );
103  $data->setValue( $value );
104  $data->setMetric( $metric );
105  return $data;
106  }
107 
108  public function hasData() {
109  return false;
110  }
111 
112  public function getData() {
113  return [];
114  }
115 
116  public function clearData() {
117  // Nothing to do, always empty
118  }
119 
120  public function getDataCount() {
121  return 0;
122  }
123 
124  public function setEnabled( $enabled ) {
125  // Nothing to do, null factory is always disabled.
126  }
127 }
NullStatsdDataFactory\clearData
clearData()
Clear all buffered data from the factory.
Definition: NullStatsdDataFactory.php:116
NullStatsdDataFactory
Definition: NullStatsdDataFactory.php:10
NullStatsdDataFactory\gauge
gauge( $key, $value)
This function creates a 'gauge' StatsdData.
Definition: NullStatsdDataFactory.php:27
NullStatsdDataFactory\timing
timing( $key, $time)
This function creates a 'timing' StatsdData.
Definition: NullStatsdDataFactory.php:18
NullStatsdDataFactory\decrement
decrement( $key)
This function creates a 'decrement' StatsdData object.
Definition: NullStatsdDataFactory.php:70
NullStatsdDataFactory\getDataCount
getDataCount()
Return the number of buffered statsd data entries.
Definition: NullStatsdDataFactory.php:120
NullStatsdDataFactory\getData
getData()
Return the buffered data from the factory.
Definition: NullStatsdDataFactory.php:112
NullStatsdDataFactory\setEnabled
setEnabled( $enabled)
Set collection enable status.
Definition: NullStatsdDataFactory.php:124
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:13
NullStatsdDataFactory\updateCount
updateCount( $key, $delta)
This function creates a 'updateCount' StatsdData object.
Definition: NullStatsdDataFactory.php:82
NullStatsdDataFactory\produceStatsdData
produceStatsdData( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
Produce a StatsdDataInterface Object.
Definition: NullStatsdDataFactory.php:96
NullStatsdDataFactory\hasData
hasData()
Check whether this data factory has any buffered data.
Definition: NullStatsdDataFactory.php:108
NullStatsdDataFactory\increment
increment( $key)
This function creates a 'increment' StatsdData object.
Definition: NullStatsdDataFactory.php:58