X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Fstats%2FNullStatsdDataFactory.php;h=4fa0248e6045135aaa5fa5a9f175e43ce13474a7;hb=2480aae0c97d822e10b50619e7b48b25c45af073;hp=fee792fdd1ce32f4be9cb628e63219d45a6b5d3f;hpb=24dc5218b18bfa065a101057523f39a9c046d046;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/stats/NullStatsdDataFactory.php b/includes/libs/stats/NullStatsdDataFactory.php index fee792fdd1..d346f651f8 100644 --- a/includes/libs/stats/NullStatsdDataFactory.php +++ b/includes/libs/stats/NullStatsdDataFactory.php @@ -8,7 +8,7 @@ use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface; * @author Addshore * @since 1.27 */ -class NullStatsdDataFactory implements StatsdDataFactoryInterface { +class NullStatsdDataFactory implements IBufferingStatsdDataFactory { /** * This function creates a 'timing' StatsdData. @@ -40,8 +40,8 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * and logged in users by sending the current userId of a user * with each request with a key of "uniques" (or similar). * - * @param string|array $key The metric(s) to set. - * @param float $value The value for the stats. + * @param string|array $key The metric(s) to set. + * @param float $value The value for the stats. * * @return array */ @@ -53,7 +53,6 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * This function creates a 'increment' StatsdData object. * * @param string|array $key The metric(s) to increment. - * @param float|1 $sampleRate The rate (0-1) for sampling. * * @return array */ @@ -66,7 +65,6 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * * * @param string|array $key The metric(s) to decrement. - * @param float|1 $sampleRate The rate (0-1) for sampling. * * @return mixed */ @@ -78,7 +76,7 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { * This function creates a 'updateCount' StatsdData object. * * @param string|array $key The metric(s) to decrement. - * @param integer $delta The delta to add to the each metric + * @param int $delta The delta to add to the each metric * * @return mixed */ @@ -108,4 +106,28 @@ class NullStatsdDataFactory implements StatsdDataFactoryInterface { return $data; } + /** + * Check whether this data factory has any data. + * @return bool + */ + 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. + } }