Skip to content

Commit d8e8235

Browse files
infurealbakhtiyar.issakhmetov
andauthored
feat: improve histogram buckets asserting error message (#5)
* chore: Improve asserting error message * chore: Improve asserting error message * chore: Typo * fix: Change message labels serializing --------- Co-authored-by: bakhtiyar.issakhmetov <[email protected]>
1 parent 9c77b1f commit d8e8235

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Storage/RedisStorage/HistogramRedisStorage.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,14 @@ public function fetchHistograms(): iterable
111111
);
112112
}
113113

114-
Assert::notEmpty($bucketsWithValues);
114+
Assert::notEmpty(
115+
$bucketsWithValues,
116+
sprintf(
117+
'Buckets with values are empty for [%s] metric with key [%s]',
118+
$keyWithLabels->metricName,
119+
$this->metricKeySerializer->serialize($keyWithLabels),
120+
)
121+
);
115122
$bucketsWithValues = array_map('floatval', $bucketsWithValues);
116123

117124
yield new HistogramMetricValue(

0 commit comments

Comments
 (0)