X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Fstats%2FNullStatsdDataFactory.php;h=f2e35b67bebca0ae043fd8e919604f17b4637fcb;hb=12601ff7d2796752404bfb331fccc41083d31f9f;hp=3b272e216e3c40a655e5b6a66b1afa8ff1b9bafb;hpb=e5facc46bc170c302438f60849041b0d6be75e82;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/stats/NullStatsdDataFactory.php b/includes/libs/stats/NullStatsdDataFactory.php index 3b272e216e..f2e35b67be 100644 --- a/includes/libs/stats/NullStatsdDataFactory.php +++ b/includes/libs/stats/NullStatsdDataFactory.php @@ -8,14 +8,14 @@ use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface; * @author Addshore * @since 1.27 */ -class NullStatsdDataFactory implements StatsdDataFactoryInterface { +class NullStatsdDataFactory implements IBufferingStatsdDataFactory { /** * This function creates a 'timing' StatsdData. * * @param string|array $key The metric(s) to set. * @param float $time The elapsed time (ms) to log - **/ + */ public function timing( $key, $time ) { } @@ -24,7 +24,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * * @param string|array $key The metric(s) to set. * @param float $value The value for the stats. - **/ + */ public function gauge( $key, $value ) { } @@ -44,7 +44,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * @param float $value The value for the stats. * * @return array - **/ + */ public function set( $key, $value ) { return []; } @@ -56,7 +56,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * @param float|1 $sampleRate The rate (0-1) for sampling. * * @return array - **/ + */ public function increment( $key ) { return []; } @@ -69,7 +69,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * @param float|1 $sampleRate The rate (0-1) for sampling. * * @return mixed - **/ + */ public function decrement( $key ) { return []; } @@ -81,7 +81,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * @param integer $delta The delta to add to the each metric * * @return mixed - **/ + */ public function updateCount( $key, $delta ) { return []; } @@ -95,7 +95,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * ("c" for count, "ms" for timing, "g" for gauge, "s" for set) * * @return StatsdDataInterface - **/ + */ public function produceStatsdData( $key, $value = 1, @@ -108,4 +108,28 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { return $data; } + /** + * Check whether this data factory has any data. + * @return boolean + */ + public function hasData() { + return false; + } + + /** + * Return data from the factory. + * @return StatsdData[] + */ + public function getData() { + return []; + } + + /** + * Set collection enable status. + * @param bool $enabled Will collection be enabled? + * @return void + */ + public function setEnabled( $enabled ) { + // Nothing to do, null factory is always disabled. + } }