From c25e310eaa312592f5e2502c372ef14891ce36dd Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 21 Dec 2023 15:17:46 +0100 Subject: [PATCH] Update types --- src/Metrics/Types/GaugeType.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Metrics/Types/GaugeType.php b/src/Metrics/Types/GaugeType.php index e4542f702..1803365a9 100644 --- a/src/Metrics/Types/GaugeType.php +++ b/src/Metrics/Types/GaugeType.php @@ -17,7 +17,7 @@ final class GaugeType extends AbstractType public const TYPE = 'g'; /** - * @var int|float + * @var float */ private $last; @@ -32,7 +32,7 @@ final class GaugeType extends AbstractType private $max; /** - * @var int|float + * @var float */ private $sum; @@ -48,9 +48,11 @@ public function __construct(string $key, $value, MetricsUnit $unit, array $tags, { parent::__construct($key, $unit, $tags, $timestamp); + $value = (float) $value; + $this->last = $value; - $this->min = (float) $value; - $this->max = (float) $value; + $this->min = $value; + $this->max = $value; $this->sum = $value; $this->count = 1; }