2 # This script is in the public domain.
3 # Converts the output of gnunet-zonewalk (DNS resolutions)
4 # into a proper input for gnunet-gns-benchmark.
7 # How many different groups of names should we
8 # create? 1/N will be in the 'shared' group.
10 # FILE ($1) contains results from DNS lookup; strip
11 # everything but the hostnames, remove duplicates
12 # and then randomize the order.
13 cat $1 | awk '{print $1}' | sort | uniq | shuf > $1.tmp
14 TOTAL=`cat $1.tmp | wc -l`
15 GROUP_SIZE=`expr $TOTAL / \( $NUM_TYPES + 1 \)`
17 # First group (0) is to be shared among all clients
18 for i in `seq 1 $NUM_CLIENTS`
20 cat $1.tmp | head -n $GROUP_SIZE | awk "{print 0 \" \" \$1}" > $1.$i.tmp
23 # Second group (1) is unique per client
25 for i in `seq 1 $NUM_CLIENTS`
27 END=`expr $OFF + $GROUP_SIZE`
28 cat $1.tmp | head -n $END | tail -n $GROUP_SIZE | awk "{print 1 \" \" \$1}" >> $1.$i.tmp
29 # Shuffle again, so we mix the different request categories in terms of
30 # when we issue the queries.
31 cat $1.$i.tmp | shuf > $1.$i