Skip to content

Commit 31cc34e

Browse files
committed
always return falsey when slo has no data
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent d29fe77 commit 31cc34e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-google-cloud-platform/compare/0.32.1...HEAD
66

7+
### Changed
8+
9+
* Always return falsey from `chaosgcp.monitoring.proves.valid_slo_ratio_during_window`
10+
when no data was found for the SLO
11+
712
## [0.32.1][] - 2024-05-31
813

914
[0.32.1]: https://github.com/chaostoolkit-incubator/chaostoolkit-google-cloud-platform/compare/0.32.0...0.32.1

chaosgcp/monitoring/probes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ def valid_slo_ratio_during_window(
326326

327327
logger.debug(f"Return SLO health: {response}")
328328

329+
if not response:
330+
logger.debug("SLO has no data for that period of time")
331+
return False
332+
329333
points = response[0]["points"]
330334

331335
good = 0

0 commit comments

Comments
 (0)