Openstatus
www.openstatus.dev
1VERSION 0
2
3NODE response_graph_0
4SQL >
5
6 %
7 SELECT
8 region,
9 toStartOfInterval(
10 toDateTime(cronTimestamp / 1000),
11 INTERVAL {{ Int64(interval, 30) }} MINUTE
12 ) as h,
13 toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp,
14 round(avg(latency)) as avgLatency,
15 round(quantile(0.75)(latency)) as p75Latency,
16 round(quantile(0.9)(latency)) as p90Latency,
17 round(quantile(0.95)(latency)) as p95Latency,
18 round(quantile(0.99)(latency)) as p99Latency
19 FROM ping_response__v8
20 WHERE
21 monitorId = {{ String(monitorId, '1') }}
22 {% if defined(url) %} AND url = {{ String(url) }} {% end %}
23 {% if defined(fromDate) %} AND timestamp >= {{ Int64(fromDate) }} {% end %}
24 {% if defined(toDate) %} AND timestamp <= {{ Int64(toDate) }} {% end %}
25 GROUP BY h, region
26 ORDER BY h DESC