forked from samytto/BenchmarkingRoaringOnDruid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
repeat_query_densities.sh
executable file
·66 lines (65 loc) · 1.8 KB
/
repeat_query_densities.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
# (c) the authors
# Licensed under the Apache License, Version 2.0.
#
# To benchmark SearchFilter, TimeseriesNot and TimeseriesSelect queries, the code should be adapted manually.
#
exec 1<&-
exec 2<&-
innerLoop(){
HOST=localhost:8082
START=$(($(date +%s%N)/1000000))
sed -e "s/###DATASOURCE###/$2/" druidQueries/query${1}${3}Template.json > druidQueries/query.tmp
curl -s -X POST "http://${HOST}/druid/v2/" -H 'content-type: application/json' -d @druidQueries/query.tmp > druidQueriesResults/${1}${3}_${2}.txt
END=$(($(date +%s%N)/1000000))
RETVAL=$(($END - $START))
echo $RETVAL
}
DENSITIES=("VeryLowCard" "LowCard" "MediumCard" "HighCard" )
QUERIES=( "GroupByFilter" "TopNFilter" "TimeseriesFilter" "SelectFilter" )
BITMAPS=("concise" "roaring")
OPERATORS=( "OR" "AND" )
ignore=0
for QUERY in "${QUERIES[@]}"
do
for OPERATOR in "${OPERATORS[@]}"
do
exec 1<>resDruidBenchs/${QUERY}${OPERATOR}.txt
exec 2<&1
echo "Densities concise csTime roaring rbTime"
for d in "${DENSITIES[@]}"
do
AVG_TIME_roaring=0
AVG_TIME_concise=0
for BITMAP in "${BITMAPS[@]}"
do
DATASOURCE=TPCH_benchmark_${BITMAP}_uncompressed
for ((n=0;n<10;n++))
do
ignore=$(($ignore + $(innerLoop $QUERY$OPERATOR $DATASOURCE $d)))
done
for ((n=0;n<100;n++))
do
time=$(innerLoop $QUERY$OPERATOR $DATASOURCE $d)
if [ "$BITMAP" = "roaring" ]
then
AVG_TIME_roaring=$(($AVG_TIME_roaring + $time))
elif [ "$BITMAP" = "concise" ]
then
AVG_TIME_concise=$(($AVG_TIME_concise + $time))
fi
done
if [ "$BITMAP" = "roaring" ]
then
AVG_TIME_roaring=$(($AVG_TIME_roaring / 100))
elif [ "$BITMAP" = "concise" ]
then
AVG_TIME_concise=$(($AVG_TIME_concise / 100))
fi
done
echo "${d} concise ${AVG_TIME_concise} roaring ${AVG_TIME_roaring}"
done
done
done
echo "##ignore=$ignore"