Special case opus mime detction
[mediawiki.git] / includes / libs / stats / NullStatsdDataFactory.php
blobfee792fdd1ce32f4be9cb628e63219d45a6b5d3f
1 <?php
3 use Liuggio\StatsdClient\Entity\StatsdData;
4 use Liuggio\StatsdClient\Entity\StatsdDataInterface;
5 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
7 /**
8 * @author Addshore
9 * @since 1.27
11 class NullStatsdDataFactory implements StatsdDataFactoryInterface {
13 /**
14 * This function creates a 'timing' StatsdData.
16 * @param string|array $key The metric(s) to set.
17 * @param float $time The elapsed time (ms) to log
19 public function timing( $key, $time ) {
22 /**
23 * This function creates a 'gauge' StatsdData.
25 * @param string|array $key The metric(s) to set.
26 * @param float $value The value for the stats.
28 public function gauge( $key, $value ) {
31 /**
32 * This function creates a 'set' StatsdData object
33 * A "Set" is a count of unique events.
34 * This data type acts like a counter, but supports counting
35 * of unique occurrences of values between flushes. The backend
36 * receives the number of unique events that happened since
37 * the last flush.
39 * The reference use case involved tracking the number of active
40 * and logged in users by sending the current userId of a user
41 * with each request with a key of "uniques" (or similar).
43 * @param string|array $key The metric(s) to set.
44 * @param float $value The value for the stats.
46 * @return array
48 public function set( $key, $value ) {
49 return [];
52 /**
53 * This function creates a 'increment' StatsdData object.
55 * @param string|array $key The metric(s) to increment.
56 * @param float|1 $sampleRate The rate (0-1) for sampling.
58 * @return array
60 public function increment( $key ) {
61 return [];
64 /**
65 * This function creates a 'decrement' StatsdData object.
68 * @param string|array $key The metric(s) to decrement.
69 * @param float|1 $sampleRate The rate (0-1) for sampling.
71 * @return mixed
73 public function decrement( $key ) {
74 return [];
77 /**
78 * This function creates a 'updateCount' StatsdData object.
80 * @param string|array $key The metric(s) to decrement.
81 * @param integer $delta The delta to add to the each metric
83 * @return mixed
85 public function updateCount( $key, $delta ) {
86 return [];
89 /**
90 * Produce a StatsdDataInterface Object.
92 * @param string $key The key of the metric
93 * @param int $value The amount to increment/decrement each metric by.
94 * @param string $metric The metric type
95 * ("c" for count, "ms" for timing, "g" for gauge, "s" for set)
97 * @return StatsdDataInterface
99 public function produceStatsdData(
100 $key,
101 $value = 1,
102 $metric = StatsdDataInterface::STATSD_METRIC_COUNT
104 $data = new StatsdData();
105 $data->setKey( $key );
106 $data->setValue( $value );
107 $data->setMetric( $metric );
108 return $data;