ClickHouse/benchmark/pinot/run.sh
Ilya Yatsishin 2e84e22bed Add Pinot
2022-07-07 17:05:26 +00:00

16 lines
576 B
Bash
Executable File

#!/bin/bash
TRIES=3
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
echo "{\"sql\":\"$query option(timeoutMs=300000)\"}"| tr -d ';' > query.json
RES=$(curl -s -XPOST -H'Content-Type: application/json' http://localhost:8000/query/sql/ -d @query.json | jq 'if .exceptions == [] then .timeUsedMs/1000 else "-" end' )
[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
[[ "$i" != $TRIES ]] && echo -n ", "
done
echo "],"
done