summaryrefslogtreecommitdiff
path: root/vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php')
-rw-r--r--vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php78
1 files changed, 78 insertions, 0 deletions
diff --git a/vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php b/vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php
new file mode 100644
index 00000000..9c6203db
--- /dev/null
+++ b/vendor/liuggio/statsd-php-client/src/Liuggio/StatsdClient/Entity/StatsdData.php
@@ -0,0 +1,78 @@
+<?php
+
+namespace Liuggio\StatsdClient\Entity;
+
+use Liuggio\StatsdClient\Entity\StatsdDataInterface;
+
+class StatsdData implements StatsdDataInterface
+{
+
+ private $key;
+ private $value;
+ private $metric;
+
+ /**
+ * @param string $key
+ */
+ public function setKey($key)
+ {
+ $this->key = $key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @param int $value
+ */
+ public function setValue($value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * @return int
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+
+ public function setMetric($metric)
+ {
+ $this->metric = $metric;
+ }
+
+ public function getMetric()
+ {
+ return $this->metric;
+ }
+
+ /**
+ * @param bool $withMetric
+ *
+ * @return string
+ */
+ public function getMessage($withMetric = true)
+ {
+ if (!$withMetric) {
+ return sprintf('%s:%s', $this->getKey(), $this->getValue());
+ } else {
+ return sprintf('%s:%s|%s', $this->getKey(), $this->getValue(), $this->getMetric());
+ }
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+}