mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #21846 from ClickHouse/aku/perf-test-error
more robust error handling in perf test
This commit is contained in:
commit
5ae5134147
@ -760,7 +760,7 @@ create view test_times_view as
|
|||||||
total_client_time,
|
total_client_time,
|
||||||
queries,
|
queries,
|
||||||
query_max,
|
query_max,
|
||||||
real / queries avg_real_per_query,
|
real / if(queries > 0, queries, 1) avg_real_per_query,
|
||||||
query_min,
|
query_min,
|
||||||
runs
|
runs
|
||||||
from test_time
|
from test_time
|
||||||
@ -781,7 +781,7 @@ create view test_times_view_total as
|
|||||||
sum(total_client_time),
|
sum(total_client_time),
|
||||||
sum(queries),
|
sum(queries),
|
||||||
max(query_max),
|
max(query_max),
|
||||||
sum(real) / sum(queries) avg_real_per_query,
|
sum(real) / if(sum(queries) > 0, sum(queries), 1) avg_real_per_query,
|
||||||
min(query_min),
|
min(query_min),
|
||||||
-- Totaling the number of runs doesn't make sense, but use the max so
|
-- Totaling the number of runs doesn't make sense, but use the max so
|
||||||
-- that the reporting script doesn't complain about queries being too
|
-- that the reporting script doesn't complain about queries being too
|
||||||
|
@ -263,8 +263,17 @@ for query_index in queries_to_run:
|
|||||||
for conn_index, c in enumerate(all_connections):
|
for conn_index, c in enumerate(all_connections):
|
||||||
try:
|
try:
|
||||||
prewarm_id = f'{query_prefix}.prewarm0'
|
prewarm_id = f'{query_prefix}.prewarm0'
|
||||||
|
|
||||||
|
try:
|
||||||
# Will also detect too long queries during warmup stage
|
# Will also detect too long queries during warmup stage
|
||||||
res = c.execute(q, query_id = prewarm_id, settings = {'max_execution_time': 10})
|
res = c.execute(q, query_id = prewarm_id, settings = {'max_execution_time': 10})
|
||||||
|
except clickhouse_driver.errors.Error as e:
|
||||||
|
# Add query id to the exception to make debugging easier.
|
||||||
|
e.args = (prewarm_id, *e.args)
|
||||||
|
e.message = prewarm_id + ': ' + e.message
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
print(f'prewarm\t{query_index}\t{prewarm_id}\t{conn_index}\t{c.last_query.elapsed}')
|
print(f'prewarm\t{query_index}\t{prewarm_id}\t{conn_index}\t{c.last_query.elapsed}')
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
@ -312,7 +321,7 @@ for query_index in queries_to_run:
|
|||||||
for conn_index, c in enumerate(this_query_connections):
|
for conn_index, c in enumerate(this_query_connections):
|
||||||
try:
|
try:
|
||||||
res = c.execute(q, query_id = run_id)
|
res = c.execute(q, query_id = run_id)
|
||||||
except Exception as e:
|
except clickhouse_driver.errors.Error as e:
|
||||||
# Add query id to the exception to make debugging easier.
|
# Add query id to the exception to make debugging easier.
|
||||||
e.args = (run_id, *e.args)
|
e.args = (run_id, *e.args)
|
||||||
e.message = run_id + ': ' + e.message
|
e.message = run_id + ': ' + e.message
|
||||||
@ -389,7 +398,7 @@ for query_index in queries_to_run:
|
|||||||
try:
|
try:
|
||||||
res = c.execute(q, query_id = run_id, settings = {'query_profiler_real_time_period_ns': 10000000})
|
res = c.execute(q, query_id = run_id, settings = {'query_profiler_real_time_period_ns': 10000000})
|
||||||
print(f'profile\t{query_index}\t{run_id}\t{conn_index}\t{c.last_query.elapsed}')
|
print(f'profile\t{query_index}\t{run_id}\t{conn_index}\t{c.last_query.elapsed}')
|
||||||
except Exception as e:
|
except clickhouse_driver.errors.Error as e:
|
||||||
# Add query id to the exception to make debugging easier.
|
# Add query id to the exception to make debugging easier.
|
||||||
e.args = (run_id, *e.args)
|
e.args = (run_id, *e.args)
|
||||||
e.message = run_id + ': ' + e.message
|
e.message = run_id + ': ' + e.message
|
||||||
|
Loading…
Reference in New Issue
Block a user