mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Make trace_log test to pass
This commit is contained in:
parent
eb24d19cd4
commit
83fda9fe58
@ -318,17 +318,6 @@ void ThreadStatus::detachQuery(bool exit_if_already_detached, bool thread_exits)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline UInt64 time_in_microseconds(std::chrono::time_point<std::chrono::system_clock> timepoint)
|
|
||||||
{
|
|
||||||
return std::chrono::duration_cast<std::chrono::microseconds>(timepoint.time_since_epoch()).count();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline UInt64 time_in_seconds(std::chrono::time_point<std::chrono::system_clock> timepoint)
|
|
||||||
{
|
|
||||||
return std::chrono::duration_cast<std::chrono::seconds>(timepoint.time_since_epoch()).count();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThreadStatus::logToQueryThreadLog(QueryThreadLog & thread_log)
|
void ThreadStatus::logToQueryThreadLog(QueryThreadLog & thread_log)
|
||||||
{
|
{
|
||||||
QueryThreadLogElement elem;
|
QueryThreadLogElement elem;
|
||||||
|
@ -25,11 +25,13 @@ SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(time
|
|||||||
|
|
||||||
SELECT '01473_trace_log_table_event_start_time_microseconds_test';
|
SELECT '01473_trace_log_table_event_start_time_microseconds_test';
|
||||||
SET log_queries = 1;
|
SET log_queries = 1;
|
||||||
SET query_profiler_real_time_period_ns = 0;
|
SET query_profiler_real_time_period_ns = 10000000;
|
||||||
SET query_profiler_cpu_time_period_ns = 1000000;
|
SET query_profiler_cpu_time_period_ns = 10000000;
|
||||||
-- a long enough query to trigger the query profiler and to record trace log
|
-- a long enough query to trigger the query profiler and to record trace log
|
||||||
|
SELECT count() FROM numbers(1000000000) FORMAT Null;
|
||||||
SELECT sleep(2) FORMAT Null;
|
SELECT sleep(2) FORMAT Null;
|
||||||
SYSTEM FLUSH LOGS;
|
SYSTEM FLUSH LOGS;
|
||||||
|
SELECT sleep(2) FORMAT Null;
|
||||||
WITH (
|
WITH (
|
||||||
(
|
(
|
||||||
SELECT event_time_microseconds
|
SELECT event_time_microseconds
|
||||||
|
Loading…
Reference in New Issue
Block a user