ck 每分钟查询数, 平均耗时, 最大耗时
2024-02-28 18:48:34 653
with toStartOfInterval(event_time,toIntervalSecond(60)) As time_
SELECT time_ , count(), avg(query_duration_ms), max(query_duration_ms) FROM system.query_log
WHERE event_time between '2024-01-01 00:00:00' and '2024-01-22 00:00:00' AND type='QueryFinish'
GROUP BY time_ ORDER BY count() DESC
结果示例
时间 | 时间范围内的查询数 | 平均耗时 | 最大耗时 |
---|---|---|---|
2024-01-19 04:03:00 | 9383 | 74.36374293935842 | 1119 |
2024-01-19 04:02:00 | 9381 | 74.36374293935842 | 1119 |