From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/libs/BufferingStatsdDataFactory.php | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 includes/libs/BufferingStatsdDataFactory.php (limited to 'includes/libs/BufferingStatsdDataFactory.php') diff --git a/includes/libs/BufferingStatsdDataFactory.php b/includes/libs/BufferingStatsdDataFactory.php new file mode 100644 index 00000000..ea5b09dc --- /dev/null +++ b/includes/libs/BufferingStatsdDataFactory.php @@ -0,0 +1,59 @@ +prefix = $prefix; + } + + public function produceStatsdData( $key, $value = 1, $metric = self::STATSD_METRIC_COUNT ) { + $this->buffer[] = $entity = $this->produceStatsdDataEntity(); + if ( $key !== null ) { + $prefixedKey = ltrim( $this->prefix . '.' . $key, '.' ); + $entity->setKey( $prefixedKey ); + } + if ( $value !== null ) { + $entity->setValue( $value ); + } + if ( $metric !== null ) { + $entity->setMetric( $metric ); + } + return $entity; + } + + public function getBuffer() { + return $this->buffer; + } +} -- cgit v1.2.3-54-g00ecf