mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix printing ProfileEvents on client for multiple queries
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
d46eaadacc
commit
1fa3e6a426
@ -1413,6 +1413,8 @@ void ClientBase::processParsedSingleQuery(const String & full_query, const Strin
|
||||
progress_indication.clearProgressOutput();
|
||||
logs_out_stream->writeProfileEvents(profile_events.last_block);
|
||||
logs_out_stream->flush();
|
||||
|
||||
profile_events.last_block = {};
|
||||
}
|
||||
|
||||
if (is_interactive)
|
||||
|
@ -6,3 +6,5 @@ print everything
|
||||
OK
|
||||
print each 100 ms
|
||||
OK
|
||||
check that ProfileEvents is new for each query
|
||||
OK
|
||||
|
@ -17,3 +17,7 @@ test "$profile_events" -gt 1 && echo OK || echo "FAIL ($profile_events)"
|
||||
echo 'print each 100 ms'
|
||||
profile_events="$($CLICKHOUSE_CLIENT --max_block_size 1 --print-profile-events --profile-events-delay-ms=100 -q 'select sleep(1) from numbers(2) format Null' |& grep -c 'SelectedRows')"
|
||||
test "$profile_events" -gt 1 && echo OK || echo "FAIL ($profile_events)"
|
||||
|
||||
echo 'check that ProfileEvents is new for each query'
|
||||
sleep_function_calls=$($CLICKHOUSE_CLIENT --print-profile-events --profile-events-delay-ms=-1 -n -q 'select sleep(1); select 1' |& grep -c 'SleepFunctionCalls')
|
||||
test "$sleep_function_calls" -eq 1 && echo OK || echo "FAIL ($sleep_function_calls)"
|
||||
|
Loading…
Reference in New Issue
Block a user