···11+VERSION 1
22+TOKEN "__ttl_14d_chart_all_regions_get__v1_endpoint_read_6659" READ
33+44+NODE __ttl_14d_chart_all_regions_get_0
55+SQL >
66+77+ %
88+ SELECT
99+ toStartOfInterval(
1010+ toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR
1111+ ) as h,
1212+ toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp,
1313+ round(quantile(0.5)(latency)) as p50Latency,
1414+ round(quantile(0.75)(latency)) as p75Latency,
1515+ round(quantile(0.9)(latency)) as p90Latency,
1616+ round(quantile(0.95)(latency)) as p95Latency,
1717+ round(quantile(0.99)(latency)) as p99Latency
1818+ FROM __ttl_14d_mv
1919+ WHERE monitorId = {{ String(monitorId, '1') }}
2020+ GROUP BY h
2121+ ORDER BY h DESC
2222+2323+
···11+VERSION 1
22+TOKEN "__ttl_7d_chart_all_regions_get__v1_endpoint_read_8648" READ
33+44+NODE __ttl_7d_chart_all_regions_get_0
55+SQL >
66+77+ %
88+ SELECT
99+ toStartOfInterval(
1010+ toDateTime(cronTimestamp / 1000), INTERVAL 1 HOUR
1111+ ) as h,
1212+ toUnixTimestamp64Milli(toDateTime64(h, 3)) as timestamp,
1313+ round(quantile(0.5)(latency)) as p50Latency,
1414+ round(quantile(0.75)(latency)) as p75Latency,
1515+ round(quantile(0.9)(latency)) as p90Latency,
1616+ round(quantile(0.95)(latency)) as p95Latency,
1717+ round(quantile(0.99)(latency)) as p99Latency
1818+ FROM __ttl_7d_mv
1919+ WHERE monitorId = {{ String(monitorId, '1') }}
2020+ GROUP BY h
2121+ ORDER BY h DESC
2222+2323+
+24
packages/tinybird/pipes/__ttl_7d_count.pipe
···11+VERSION 1
22+DESCRIPTION >
33+ TODO: descripe what it is for!
44+55+66+NODE __ttl_7d_count_0
77+SQL >
88+99+ SELECT
1010+ time,
1111+ monitorId,
1212+ url,
1313+ countState() AS count,
1414+ countState(if(error = 0, 1, NULL)) AS ok
1515+ FROM __ttl_45d_mv
1616+ GROUP BY
1717+ time,
1818+ monitorId,
1919+ url
2020+2121+TYPE materialized
2222+DATASOURCE __ttl_7d_count_mv
2323+2424+
+22
packages/tinybird/pipes/__ttl_7d_count_get.pipe
···11+VERSION 1
22+TOKEN "__ttl_7d_count_get__v1_endpoint_read_7412" READ
33+44+NODE __ttl_7d_count_get_0
55+SQL >
66+77+ %
88+ SELECT time as day, countMerge(count) as count, countMerge(ok) as ok
99+ FROM __ttl_7d_count_mv_test
1010+ WHERE
1111+ monitorId = {{ String(monitorId, '4') }}
1212+ {% if defined(url) %} AND url = {{ String(url) }} {% end %}
1313+ GROUP BY day
1414+ ORDER BY day DESC
1515+ WITH FILL
1616+ FROM
1717+ toStartOfDay(now())
1818+ TO toStartOfDay(
1919+ date_sub(DAY, 7, now())
2020+ ) STEP INTERVAL -1 DAY
2121+2222+