mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
21 lines
495 B
Bash
21 lines
495 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
TRIES=3
|
||
|
QUERY_NUM=1
|
||
|
cat queries.sql | while read query; do
|
||
|
sync
|
||
|
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
|
||
|
|
||
|
echo -n "["
|
||
|
for i in $(seq 1 $TRIES); do
|
||
|
RES=$(clickhouse-client --time --format=Null --query="$query" 2>&1 ||:)
|
||
|
[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
|
||
|
[[ "$i" != $TRIES ]] && echo -n ", "
|
||
|
|
||
|
echo "${QUERY_NUM},${i},${RES}" >> result.csv
|
||
|
done
|
||
|
echo "],"
|
||
|
|
||
|
QUERY_NUM=$((QUERY_NUM + 1))
|
||
|
done
|