···11-VERSION 0
11+VERSION 1
2233TOKEN "monitor_list__v0_endpoint_read_0539" READ
4455-NODE monitor_list__v0_0
55+NODE monitor_list__v1_0
66SQL >
7788 %
99- SELECT
1010- {% if defined(groupBy) and groupBy == "day" %}
99+ SELECT
1010+ {% if defined(groupBy) and groupBy == "day" %}
1111 toUnixTimestamp64Milli(toDateTime64(DATE(cronTimestamp / 1000), 3))
1212 {% else %}
1313 cronTimestamp
1414 {% end %}
1515 AS cronTimestamp, ROUND(AVG(latency)) as avgLatency, COUNT(*) as count, COUNT(CASE WHEN statusCode BETWEEN 200 AND 299 THEN 1 ELSE NULL END) as ok
1616 FROM ping_response__v2
1717- WHERE id = {{ String(siteId, 'openstatus') }} AND cronTimestamp IS NOT NULL
1717+ WHERE monitorId = {{ String(monitorId, 'openstatusPing') }} AND cronTimestamp IS NOT NULL
1818 GROUP BY cronTimestamp
1919 ORDER BY cronTimestamp DESC
2020 LIMIT {{Int32(limit, 1000)}}
+4-4
packages/tinybird/pipes/response_list.pipe
···11-VERSION 1
11+VERSION 2
2233-NODE response_list__v1_0
33+NODE response_list__v2_0
44SQL >
5566 %
77 SELECT *
88 FROM ping_response__v2
99- WHERE id = {{ String(siteId, 'openstatus') }}
99+ WHERE monitorId = {{ String(monitorId, 'openstatusPing') }}
1010 {% if defined(region) %}
1111 AND region = {{ String(region) }}
1212 {% end %}
···2020 AND cronTimestamp <= {{ Int64(toDate) }}
2121 {% end %}
2222 ORDER BY timestamp DESC
2323- LIMIT {{Int32(limit, 100)}}
2323+ LIMIT {{Int32(limit, 100)}}