Druid: check correct result in check query

This commit is contained in:
Ilya Yatsishin 2022-07-11 11:23:11 +00:00
parent 0ef3af67f8
commit cc8810e72a
2 changed files with 40 additions and 40 deletions

View File

@ -11,48 +11,48 @@
"data_size": 45188608472,
"result": [
[0.022610, 0.015202, 0.015416],
[0.408549, 0.275624, 0.275657],
[0.365362, 0.159893, 0.151254],
[1.380429, 0.136963, 0.131130],
[3.126491, 2.462627, 2.431463],
[9.350598, 7.418928, 7.213518],
[0.032365, 0.016716, 0.016921],
[0.400766, 0.275591, 0.271057],
[0.382350, 0.152084, 0.151652],
[1.379492, 0.137201, 0.128902],
[3.278731, 2.527105, 2.515128],
[8.576382, 6.546540, 6.503001],
[null, null, null],
[0.532669, 0.278820, 0.270483],
[7.541045, 6.631755, 6.555070],
[8.634310, 7.615905, 7.573183],
[1.650839, 0.832760, 0.881859],
[1.680002, 0.504994, 0.512728],
[2.406642, 1.939866, 1.667841],
[8.632186, 7.264837, 7.358885],
[61.095584, 59.243483, 59.111986],
[0.006551, 0.005535, 0.004936],
[0.010023, 0.010525, 0.009739],
[0.009157, 0.008836, 0.008432],
[null, null, null],
[0.005462, 0.004723, 0.004469],
[0.006079, 0.005037, 0.005726],
[0.563852, 0.273795, 0.275086],
[11.509993, 10.636571, 10.597993],
[13.357647, 12.421210, 12.337247],
[1.636875, 0.821300, 0.900056],
[1.692544, 0.512066, 0.440511],
[2.453274, 1.769806, 1.807207],
[8.503408, 7.261406, 7.334872],
[61.056041, 59.251083, 59.500549],
[8.620670, 8.236657, 8.225380],
[164.840762, null, null],
[24.165797, 22.308466, null],
[null, null, null],
[null, null, null],
[0.009679, 0.009139, 0.011461],
[0.006833, 0.005752, 0.005962],
[25.973369, 25.597864, 25.602509],
[null, null, null],
[null, null, null],
[0.011282, 0.009306, 0.009612],
[7.805347, 6.629776, 6.947366],
[0.257845, 0.020327, 0.016976],
[null, null, null],
[0.042850, 0.047030, 0.040549],
[0.013658, 0.013335, 0.013686],
[0.018262, 0.012727, 0.012357],
[0.013259, 0.011685, 0.011177],
[0.006448, 0.005744, 0.005489],
[0.006924, 0.008225, 0.006115],
[60.505400, 59.499392, 59.221125],
[0.010123, 0.008507, 0.008990],
[0.010177, 0.008739, 0.009381],
[0.011097, 0.009424, 0.013203],
[null, null, null],
[0.014453, 0.013647, 0.013853],
[0.017409, 0.013077, 0.012445],
[0.010489, 0.009483, 0.009735]
]
[32.948154, 31.046770, 29.221959],
[null, null, null],
[7.230865, 7.033713, 6.972421],
[20.546250, 19.237428, 19.258469],
[54.065945, 52.451318, 52.466653],
[null, null, null],
[17.499267, null, null],
[null, null, null],
[60.478315, 60.054940, 60.458946],
[1.698088, 1.490317, 1.461969],
[1.409572, 0.939003, 0.907252],
[0.866729, 0.329539, 0.287435],
[null, null, null],
[0.932473, 0.420781, 0.359095],
[0.723142, 0.325300, 0.296865],
[0.603483, 0.150892, 0.140716]
]
}

View File

@ -4,16 +4,16 @@ TRIES=3
cat queries.sql | while read query; do
sync
for i in $(seq 1 100); do
CHECK=$(curl -o /dev/null -w '%{http_code}' -s -XPOST -H'Content-Type: application/json' http://localhost:8888/druid/v2/sql/ -d @check.json })
if [[ "$CHECK" == "200" ]]; then
CHECK=$(curl -o - -w '%{http_code}' -s -XPOST -H'Content-Type: application/json' http://localhost:8888/druid/v2/sql/ -d @check.json })
if [[ "$CHECK" == "[{\"EXPR\$0\":99997497}]"$'\n'"200" ]]; then
break
fi
sleep 1
done
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
echo "{\"query\":\"$query\", \"context\": {\"timeout\": 1000000} }"| sed -e 's EventTime __time g' | tr -d ';' > query.json
echo -n "["
for i in $(seq 1 $TRIES); do
echo "{\"query\":\"$query\", \"context\": {\"timeout\": 1000000} }"| sed -e 's EventTime __time g' | tr -d ';' > query.json
curl -o /dev/null -w '%{http_code} %{time_total}\n' -s -XPOST -H'Content-Type: application/json' http://localhost:8888/druid/v2/sql/ -d @query.json | awk '{ if($1=="200") printf $2; else printf "null"; }'
[[ "$i" != $TRIES ]] && echo -n ", "
done