distribution.sh 574 Bytes
Newer Older
Sylvain Schmitz's avatar
Sylvain Schmitz committed
1
#!/bin/bash
2 3
# count the number of queries of each size
# argument: the size of blocks of queries, 1 by default
Sylvain Schmitz's avatar
Sylvain Schmitz committed
4

5 6 7 8 9 10 11
if [ "$#" -ne 1 ]
then
    step=1
else
    step=$1
fi
fragments=`grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
Sylvain Schmitz's avatar
Sylvain Schmitz committed
12 13
MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`

14
for ((i = 1; i < $MAX; i+=$step))
Sylvain Schmitz's avatar
Sylvain Schmitz committed
15
do
16 17 18 19 20 21
    C=0
    for ((j = $i; j < $i+$step; ++j))
    do
        G=`grep "ast depth=.* size=\"$j\"" $fragments | wc -l`
        C=$((C + G))
    done
Sylvain Schmitz's avatar
Sylvain Schmitz committed
22 23 24
    echo "$i $C"
done