diff --git a/src/M6Web/Component/Statsd/Client.php b/src/M6Web/Component/Statsd/Client.php index e3b8d4f..a14156b 100644 --- a/src/M6Web/Component/Statsd/Client.php +++ b/src/M6Web/Component/Statsd/Client.php @@ -158,7 +158,7 @@ public function getServerKey($stats) protected function addToSend($stats, $value, $sampleRate, $unit, $tags) { $message = new MessageEntity( - (string) $stats, (int) $value, (string) $unit, (float) $sampleRate, $tags + (string) $stats, $value, (string) $unit, (float) $sampleRate, $tags ); $queue = [ diff --git a/src/M6Web/Component/Statsd/MessageEntity.php b/src/M6Web/Component/Statsd/MessageEntity.php index bc0359d..5d75029 100644 --- a/src/M6Web/Component/Statsd/MessageEntity.php +++ b/src/M6Web/Component/Statsd/MessageEntity.php @@ -25,11 +25,11 @@ class MessageEntity protected $tags = []; /** - * @param string $node node - * @param int $value value of the node - * @param string $unit units (ms for timer, c for counting ...) - * @param float $sampleRate sampling rate - * @param array $tags Tags key => value for influxDb + * @param string $node node + * @param int|string $value value of the node + * @param string $unit units (ms for timer, c for counting ...) + * @param float $sampleRate sampling rate + * @param array $tags Tags key => value for influxDb * * @return MessageEntity */ @@ -60,7 +60,7 @@ protected function checkConstructor() throw new Exception('node and unit have to be a string'); } - if (!is_int($this->value)) { + if (!is_int(intval($this->value))) { throw new Exception('value has to be an integer'); }