Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / includes / libs / stats / NullStatsdDataFactory.php
index 3b272e2..4fa0248 100644 (file)
@@ -8,14 +8,14 @@ use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
  * @author Addshore
  * @since 1.27
  */
-class NullStatsdDataFactory implements StatsdDataFactoryInterface {
+class NullStatsdDataFactory implements MediawikiStatsdDataFactory {
 
        /**
         * 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.
+       }
 }