* @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 ) {
}
*
* @param string|array $key The metric(s) to set.
* @param float $value The value for the stats.
- **/
+ */
public function gauge( $key, $value ) {
}
* @param float $value The value for the stats.
*
* @return array
- **/
+ */
public function set( $key, $value ) {
return [];
}
* @param float|1 $sampleRate The rate (0-1) for sampling.
*
* @return array
- **/
+ */
public function increment( $key ) {
return [];
}
* @param float|1 $sampleRate The rate (0-1) for sampling.
*
* @return mixed
- **/
+ */
public function decrement( $key ) {
return [];
}
* @param integer $delta The delta to add to the each metric
*
* @return mixed
- **/
+ */
public function updateCount( $key, $delta ) {
return [];
}
* ("c" for count, "ms" for timing, "g" for gauge, "s" for set)
*
* @return StatsdDataInterface
- **/
+ */
public function produceStatsdData(
$key,
$value = 1,
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.
+ }
}