MediaWiki  1.30.0
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 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
6 
12 
19  public function timing( $key, $time ) {
20  }
21 
28  public function gauge( $key, $value ) {
29  }
30 
48  public function set( $key, $value ) {
49  return [];
50  }
51 
59  public function increment( $key ) {
60  return [];
61  }
62 
71  public function decrement( $key ) {
72  return [];
73  }
74 
83  public function updateCount( $key, $delta ) {
84  return [];
85  }
86 
97  public function produceStatsdData(
98  $key,
99  $value = 1,
100  $metric = StatsdDataInterface::STATSD_METRIC_COUNT
101  ) {
102  $data = new StatsdData();
103  $data->setKey( $key );
104  $data->setValue( $value );
105  $data->setMetric( $metric );
106  return $data;
107  }
108 
113  public function hasData() {
114  return false;
115  }
116 
121  public function getData() {
122  return [];
123  }
124 
130  public function setEnabled( $enabled ) {
131  // Nothing to do, null factory is always disabled.
132  }
133 }
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
NullStatsdDataFactory
Definition: NullStatsdDataFactory.php:11
NullStatsdDataFactory\gauge
gauge( $key, $value)
This function creates a 'gauge' StatsdData.
Definition: NullStatsdDataFactory.php:28
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
NullStatsdDataFactory\timing
timing( $key, $time)
This function creates a 'timing' StatsdData.
Definition: NullStatsdDataFactory.php:19
NullStatsdDataFactory\decrement
decrement( $key)
This function creates a 'decrement' StatsdData object.
Definition: NullStatsdDataFactory.php:71
$time
see documentation in includes Linker php for Linker::makeImageLink & $time
Definition: hooks.txt:1778
NullStatsdDataFactory\getData
getData()
Return data from the factory.
Definition: NullStatsdDataFactory.php:121
NullStatsdDataFactory\setEnabled
setEnabled( $enabled)
Set collection enable status.
Definition: NullStatsdDataFactory.php:130
$value
$value
Definition: styleTest.css.php:45
IBufferingStatsdDataFactory
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Definition: IBufferingStatsdDataFactory.php:10
NullStatsdDataFactory\updateCount
updateCount( $key, $delta)
This function creates a 'updateCount' StatsdData object.
Definition: NullStatsdDataFactory.php:83
NullStatsdDataFactory\produceStatsdData
produceStatsdData( $key, $value=1, $metric=StatsdDataInterface::STATSD_METRIC_COUNT)
Produce a StatsdDataInterface Object.
Definition: NullStatsdDataFactory.php:97
NullStatsdDataFactory\hasData
hasData()
Check whether this data factory has any data.
Definition: NullStatsdDataFactory.php:113
NullStatsdDataFactory\increment
increment( $key)
This function creates a 'increment' StatsdData object.
Definition: NullStatsdDataFactory.php:59