mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
21 lines
495 B
Bash
Executable File
21 lines
495 B
Bash
Executable File
#!/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
|