From 3dfb7df74a14450e2e915da3241402433c137a01 Mon Sep 17 00:00:00 2001 From: Arkadiusz Kondas Date: Mon, 10 Jun 2019 09:10:59 +0200 Subject: [PATCH] Rely on bucket count instead of hIncrByFloat return value --- src/Prometheus/Storage/Redis.php | 6 +++--- tests/Test/Prometheus/AbstractHistogramTest.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 091577c..34c3752 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -122,9 +122,9 @@ public function updateHistogram(array $data) unset($metaData['value']); unset($metaData['labelValues']); $this->redis->eval(<<observe(0.11); + $histogram->observe(1343.11); $histogram->observe(0.3); $this->assertThat( $this->adapter->collect(), @@ -200,13 +200,13 @@ public function itShouldObserveValuesOfTypeDouble() 'name' => 'test_some_metric_bucket', 'labelNames' => array('le'), 'labelValues' => array(0.2), - 'value' => 1, + 'value' => 0, ), array( 'name' => 'test_some_metric_bucket', 'labelNames' => array('le'), 'labelValues' => array(0.3), - 'value' => 2, + 'value' => 1, ), array( 'name' => 'test_some_metric_bucket', @@ -224,7 +224,7 @@ public function itShouldObserveValuesOfTypeDouble() 'name' => 'test_some_metric_sum', 'labelNames' => array(), 'labelValues' => array(), - 'value' => 0.41, + 'value' => 1343.41000000000000003, ) ) )