ClickHouse/dbms/tests/queries/0_stateless/00974_query_profiler.sql

17 lines
1.1 KiB
MySQL
Raw Normal View History

2019-07-30 18:01:59 +00:00
SET allow_introspection_functions = 1;
2019-07-24 01:04:46 +00:00
SET query_profiler_real_time_period_ns = 100000000;
2019-07-24 01:11:46 +00:00
SET log_queries = 1;
2019-07-24 01:04:46 +00:00
SELECT sleep(0.5), ignore('test real time query profiler');
2019-07-24 01:11:46 +00:00
SET log_queries = 0;
2019-07-24 01:04:46 +00:00
SYSTEM FLUSH LOGS;
2019-07-30 15:19:57 +00:00
WITH addressToSymbol(arrayJoin(trace)) AS symbol SELECT count() > 0 FROM system.trace_log t WHERE event_date >= yesterday() AND query_id = (SELECT query_id FROM system.query_log WHERE event_date >= yesterday() AND query LIKE '%test real time query profiler%' ORDER BY event_time DESC LIMIT 1) AND symbol LIKE '%FunctionSleep%';
2019-07-24 01:04:46 +00:00
SET query_profiler_real_time_period_ns = 0;
SET query_profiler_cpu_time_period_ns = 100000000;
2019-07-24 01:11:46 +00:00
SET log_queries = 1;
2019-07-24 01:04:46 +00:00
SELECT count(), ignore('test cpu time query profiler') FROM numbers(1000000000);
2019-07-24 01:11:46 +00:00
SET log_queries = 0;
2019-07-24 01:04:46 +00:00
SYSTEM FLUSH LOGS;
2019-07-30 15:19:57 +00:00
WITH addressToSymbol(arrayJoin(trace)) AS symbol SELECT count() > 0 FROM system.trace_log t WHERE event_date >= yesterday() AND query_id = (SELECT query_id FROM system.query_log WHERE event_date >= yesterday() AND query LIKE '%test cpu time query profiler%' ORDER BY event_time DESC LIMIT 1) AND symbol LIKE '%Numbers%';