Openstatus
www.openstatus.dev
1VERSION 0
2
3TAGS http
4
5NODE endpoint
6SQL >
7
8 %
9 SELECT
10 round(quantile(0.50)(latency)) as p50Latency,
11 round(quantile(0.75)(latency)) as p75Latency,
12 round(quantile(0.90)(latency)) as p90Latency,
13 round(quantile(0.95)(latency)) as p95Latency,
14 round(quantile(0.99)(latency)) as p99Latency,
15 count() as count,
16 count(if(error = 0, 1, NULL)) AS ok,
17 max(cronTimestamp) AS lastTimestamp
18 FROM mv__http_14d__v0
19 WHERE
20 monitorId = {{ String(monitorId, '1', required=True) }}
21 AND time >= toDateTime64(now() - INTERVAL 14 DAY, 3)
22 UNION ALL
23 SELECT
24 round(quantile(0.50)(latency)) AS p50Latency,
25 round(quantile(0.75)(latency)) AS p75Latency,
26 round(quantile(0.90)(latency)) AS p90Latency,
27 round(quantile(0.95)(latency)) AS p95Latency,
28 round(quantile(0.99)(latency)) AS p99Latency,
29 count() as count,
30 count(if(error = 0, 1, NULL)) AS ok,
31 NULL as lastTimestamp -- no need to query the `lastTimestamp` as not relevant
32 FROM mv__http_30d__v0
33 WHERE
34 monitorId = {{ String(monitorId, '1', required=True) }}
35 AND time >= toDateTime64(now() - INTERVAL 28 DAY, 3)
36 AND time < toDateTime64(now() - INTERVAL 14 DAY, 3)
37
38
39TYPE ENDPOINT