Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"displayType": "table",
"name": "RFO timeline, from the cell counters and core probes",
"source": "ran-kpis",
"sqlTemplate": "SELECT concat(toString(dateDiff('minute', started, now())), ' min ago') AS \"Started\",\n if(ended >= now() - INTERVAL 5 MINUTE, 'ongoing', concat(toString(dateDiff('minute', ended, now())), ' min ago')) AS \"Ended\",\n dateDiff('minute', started, ended) AS \"Minutes\",\n what AS \"What\",\n place AS \"Where\",\n evidence AS \"Evidence\"\nFROM (\n SELECT min(_timestamp) AS started, max(_timestamp) + INTERVAL 5 MINUTE AS ended, 'RSRP drop' AS what, concat(cell, ' on ', site) AS place,\n concat('RSRP down to ', toString(round(min(rsrp), 1)), ' dBm from a normal ', toString(round(any(rsrp_base), 1))) AS evidence\n FROM (SELECT k._timestamp AS _timestamp, k.cell AS cell, k.site AS site, k.rsrp AS rsrp, b.rsrp_base AS rsrp_base, k.users AS users,\n k.dl / greatest(k.users, 1) / b.rate_base AS rate_ratio,\n k.rsrp < b.rsrp_base - 8 AS rsrp_drop,\n k.dl / greatest(k.users, 1) < 0.25 * b.rate_base AND k.rsrp >= b.rsrp_base - 3 AS collapse\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site, toFloat64(_json.rsrp_dbm) AS rsrp, toFloat64(_json.dl_throughput_mbps) AS dl, toFloat64(_json.active_users) AS users FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp)) AS k\n INNER JOIN (SELECT toString(_json.cell) AS cell, median(toFloat64(_json.rsrp_dbm)) AS rsrp_base, median(toFloat64(_json.dl_throughput_mbps) / greatest(toFloat64(_json.active_users), 1)) AS rate_base FROM dfe.`ran-kpis` GROUP BY cell) AS b ON k.cell = b.cell)\n WHERE rsrp_drop\n GROUP BY cell, site, toStartOfInterval(_timestamp, INTERVAL 30 MINUTE)\n UNION ALL\n SELECT min(_timestamp), max(_timestamp) + INTERVAL 5 MINUTE, 'Throughput collapse', concat(cell, ' on ', site),\n concat('Mbps per user down to ', toString(round(100 * min(rate_ratio))), '% of normal with RSRP normal and ', toString(round(avg(users))), ' users still attached')\n FROM (SELECT k._timestamp AS _timestamp, k.cell AS cell, k.site AS site, k.rsrp AS rsrp, b.rsrp_base AS rsrp_base, k.users AS users,\n k.dl / greatest(k.users, 1) / b.rate_base AS rate_ratio,\n k.rsrp < b.rsrp_base - 8 AS rsrp_drop,\n k.dl / greatest(k.users, 1) < 0.25 * b.rate_base AND k.rsrp >= b.rsrp_base - 3 AS collapse\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site, toFloat64(_json.rsrp_dbm) AS rsrp, toFloat64(_json.dl_throughput_mbps) AS dl, toFloat64(_json.active_users) AS users FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp)) AS k\n INNER JOIN (SELECT toString(_json.cell) AS cell, median(toFloat64(_json.rsrp_dbm)) AS rsrp_base, median(toFloat64(_json.dl_throughput_mbps) / greatest(toFloat64(_json.active_users), 1)) AS rate_base FROM dfe.`ran-kpis` GROUP BY cell) AS b ON k.cell = b.cell)\n WHERE collapse\n GROUP BY cell, site, toStartOfInterval(_timestamp, INTERVAL 30 MINUTE)\n UNION ALL\n SELECT started, ended, 'Cell silent', concat(cell, ' on ', site), 'no PM counters reported'\n FROM (SELECT cell, site, previous + INTERVAL 5 MINUTE AS started, _timestamp AS ended\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site,\n lagInFrame(_timestamp, 1, toDateTime64(0, 3, 'UTC')) OVER (PARTITION BY cell ORDER BY _timestamp ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous\n FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp))\n WHERE toUnixTimestamp(previous) > 0 AND dateDiff('second', previous, _timestamp) > 360)\n UNION ALL\n SELECT min(minute), max(minute) + INTERVAL 1 MINUTE, concat(procedure, ' failure burst'), concat('core, ', any(interface)),\n concat(toString(sum(failures)), ' of ', toString(sum(attempts)), ' attempts failed, mostly ', any(cause), ', p95 up to ', toString(round(max(p95))), ' ms')\n FROM (SELECT toStartOfMinute(_timestamp) AS minute, toString(_json.procedure) AS procedure, toString(_json.interface) AS interface,\n count() AS attempts, countIf(toString(_json.result) = 'failure') AS failures, topKIf(1)(toString(_json.cause), toString(_json.result) = 'failure')[1] AS cause, quantile(0.95)(toFloat64(_json.latency_ms)) AS p95\n FROM dfe.`core-probes` WHERE $__timeFilter(_timestamp)\n GROUP BY minute, procedure, interface\n HAVING attempts >= 2 AND failures * 5 >= attempts AND p95 >= 100)\n GROUP BY procedure, toStartOfInterval(minute, INTERVAL 30 MINUTE))\nORDER BY started"
"sqlTemplate": "SELECT concat(toString(dateDiff('minute', started, now())), ' min ago') AS \"Started\",\n if(ended >= now() - INTERVAL 5 MINUTE, 'ongoing', concat(toString(dateDiff('minute', ended, now())), ' min ago')) AS \"Ended\",\n dateDiff('minute', started, ended) AS \"Minutes\",\n what AS \"What\",\n place AS \"Where\",\n evidence AS \"Evidence\"\nFROM (\n SELECT min(_timestamp) AS started, max(_timestamp) + INTERVAL 5 MINUTE AS ended, 'RSRP drop' AS what, concat(cell, ' on ', site) AS place,\n concat('RSRP down to ', toString(round(min(rsrp), 1)), ' dBm from a normal ', toString(round(any(rsrp_base), 1))) AS evidence\n FROM (\n SELECT _timestamp, cell, site, rsrp, rsrp_base,\n sum(new_episode) OVER (PARTITION BY cell, site ORDER BY _timestamp ROWS UNBOUNDED PRECEDING) AS episode\n FROM (\n SELECT _timestamp, cell, site, rsrp, rsrp_base,\n if(toUnixTimestamp(previous) = 0 OR dateDiff('second', previous, _timestamp) > 600, 1, 0) AS new_episode\n FROM (\n SELECT _timestamp, cell, site, rsrp, rsrp_base,\n lagInFrame(_timestamp, 1, toDateTime64(0, 3, 'UTC')) OVER (PARTITION BY cell, site ORDER BY _timestamp ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous\n FROM (SELECT k._timestamp AS _timestamp, k.cell AS cell, k.site AS site, k.rsrp AS rsrp, b.rsrp_base AS rsrp_base\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site, toFloat64(_json.rsrp_dbm) AS rsrp, toFloat64(_json.dl_throughput_mbps) AS dl, toFloat64(_json.active_users) AS users FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp)) AS k\n INNER JOIN (SELECT toString(_json.cell) AS cell, median(toFloat64(_json.rsrp_dbm)) AS rsrp_base, median(toFloat64(_json.dl_throughput_mbps) / greatest(toFloat64(_json.active_users), 1)) AS rate_base FROM dfe.`ran-kpis` GROUP BY cell) AS b ON k.cell = b.cell\n WHERE k.rsrp < b.rsrp_base - 8)\n )\n )\n )\n GROUP BY cell, site, episode\n UNION ALL\n SELECT min(_timestamp), max(_timestamp) + INTERVAL 5 MINUTE, 'Throughput collapse', concat(cell, ' on ', site),\n concat('Mbps per user down to ', toString(round(100 * min(rate_ratio))), '% of normal with RSRP normal and ', toString(round(avg(users))), ' users still attached')\n FROM (\n SELECT _timestamp, cell, site, rate_ratio, users,\n sum(new_episode) OVER (PARTITION BY cell, site ORDER BY _timestamp ROWS UNBOUNDED PRECEDING) AS episode\n FROM (\n SELECT _timestamp, cell, site, rate_ratio, users,\n if(toUnixTimestamp(previous) = 0 OR dateDiff('second', previous, _timestamp) > 600, 1, 0) AS new_episode\n FROM (\n SELECT _timestamp, cell, site, rate_ratio, users,\n lagInFrame(_timestamp, 1, toDateTime64(0, 3, 'UTC')) OVER (PARTITION BY cell, site ORDER BY _timestamp ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous\n FROM (SELECT k._timestamp AS _timestamp, k.cell AS cell, k.site AS site, k.dl / greatest(k.users, 1) / b.rate_base AS rate_ratio, k.users AS users\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site, toFloat64(_json.rsrp_dbm) AS rsrp, toFloat64(_json.dl_throughput_mbps) AS dl, toFloat64(_json.active_users) AS users FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp)) AS k\n INNER JOIN (SELECT toString(_json.cell) AS cell, median(toFloat64(_json.rsrp_dbm)) AS rsrp_base, median(toFloat64(_json.dl_throughput_mbps) / greatest(toFloat64(_json.active_users), 1)) AS rate_base FROM dfe.`ran-kpis` GROUP BY cell) AS b ON k.cell = b.cell\n WHERE k.dl / greatest(k.users, 1) < 0.25 * b.rate_base AND k.rsrp >= b.rsrp_base - 3)\n )\n )\n )\n GROUP BY cell, site, episode\n UNION ALL\n SELECT started, ended, 'Cell silent', concat(cell, ' on ', site), 'no PM counters reported'\n FROM (SELECT cell, site, previous + INTERVAL 5 MINUTE AS started, _timestamp AS ended\n FROM (SELECT _timestamp, toString(_json.cell) AS cell, toString(_json.site) AS site,\n lagInFrame(_timestamp, 1, toDateTime64(0, 3, 'UTC')) OVER (PARTITION BY cell ORDER BY _timestamp ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous\n FROM dfe.`ran-kpis` WHERE $__timeFilter(_timestamp))\n WHERE toUnixTimestamp(previous) > 0 AND dateDiff('second', previous, _timestamp) > 360)\n UNION ALL\n SELECT min(minute), max(minute) + INTERVAL 1 MINUTE, concat(procedure, ' failure burst'), concat('core, ', any(interface)),\n concat(toString(sum(failures)), ' of ', toString(sum(attempts)), ' attempts failed, mostly ', any(cause), ', p95 up to ', toString(round(max(p95))), ' ms')\n FROM (\n SELECT minute, procedure, interface, attempts, failures, cause, p95,\n sum(new_episode) OVER (PARTITION BY procedure ORDER BY minute ROWS UNBOUNDED PRECEDING) AS episode\n FROM (\n SELECT minute, procedure, interface, attempts, failures, cause, p95,\n if(toUnixTimestamp(previous) = 0 OR dateDiff('second', previous, minute) > 600, 1, 0) AS new_episode\n FROM (\n SELECT minute, procedure, interface, attempts, failures, cause, p95,\n lagInFrame(minute, 1, toDateTime(0)) OVER (PARTITION BY procedure ORDER BY minute ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS previous\n FROM (SELECT toStartOfMinute(_timestamp) AS minute, toString(_json.procedure) AS procedure, toString(_json.interface) AS interface,\n count() AS attempts, countIf(toString(_json.result) = 'failure') AS failures, topKIf(1)(toString(_json.cause), toString(_json.result) = 'failure')[1] AS cause, quantile(0.95)(toFloat64(_json.latency_ms)) AS p95\n FROM dfe.`core-probes` WHERE $__timeFilter(_timestamp)\n GROUP BY minute, procedure, interface\n HAVING attempts >= 2 AND failures * 5 >= attempts AND p95 >= 100)\n )\n )\n )\n GROUP BY procedure, episode)\nORDER BY started"
},
"h": 8,
"id": "timeline",
Expand Down