Skip to content

Commit 0eb9760

Browse files
committed
Prevent uptime to show over 100% that usually happen when we create new service to monitor
1 parent 1c63355 commit 0eb9760

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clickhouse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export async function updateMonitorStatus(monitorId: string): Promise<void> {
183183
SELECT
184184
CASE
185185
WHEN expected_intervals = 0 THEN 100
186-
ELSE (actual_intervals * 100.0 / expected_intervals)
186+
ELSE LEAST(100, (actual_intervals * 100.0 / expected_intervals))
187187
END AS uptime
188188
FROM expected, actual
189189
`;

0 commit comments

Comments
 (0)