diff options
author | Nils Gillmann <ng0@n0.is> | 2018-05-19 14:43:13 +0000 |
---|---|---|
committer | Nils Gillmann <ng0@n0.is> | 2018-05-19 14:43:13 +0000 |
commit | 6ab60d4920bb3199aee8cd872b930e9e3e808ba7 (patch) | |
tree | 3d761dbf8793a1d2422fbd14667255c7e0292ea4 /contrib/scripts/zonewalk-to-types.sh | |
parent | c2f27dfe8218545c327ab49d225a49910347c5c6 (diff) | |
download | gnunet-6ab60d4920bb3199aee8cd872b930e9e3e808ba7.tar.gz gnunet-6ab60d4920bb3199aee8cd872b930e9e3e808ba7.zip |
Restructure contrib folder.
contrib/pogen.sh -> bin/pogen.sh
bootstrap: Use new pogen location and execute it.
contrib/openvpn-tap32: Move to contrib/3rdparty/Windows/openvpn-tap32.
contrib/gnunet-logo*: Move to contrib/branding/logo/
Delete old patches in contrib, predating git.
Move buildbot data to contrib/ci/buildbot,
move docker data to contrib/ci/docker.
Create contrib/conf and populate it with config files found in contrib and bin.
Move gns related data to contrib/gns.
delete contrib/repeat.sh
Move contrib/log.php into contrib/web/log.php.
Create folder contrib/scripts and use it for most scripts in contrib.
Remove trailing whitespace in doc/Makefile.am
Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'contrib/scripts/zonewalk-to-types.sh')
-rwxr-xr-x | contrib/scripts/zonewalk-to-types.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/scripts/zonewalk-to-types.sh b/contrib/scripts/zonewalk-to-types.sh new file mode 100755 index 000000000..c453702e6 --- /dev/null +++ b/contrib/scripts/zonewalk-to-types.sh | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
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. | ||
5 | |||
6 | NUM_CLIENTS=3 | ||
7 | # How many different groups of names should we | ||
8 | # create? 1/N will be in the 'shared' group. | ||
9 | |||
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 \)` | ||
16 | |||
17 | # First group (0) is to be shared among all clients | ||
18 | for i in `seq 1 $NUM_CLIENTS` | ||
19 | do | ||
20 | cat $1.tmp | head -n $GROUP_SIZE | awk "{print 0 \" \" \$1}" > $1.$i.tmp | ||
21 | done | ||
22 | |||
23 | # Second group (1) is unique per client | ||
24 | OFF=0 | ||
25 | for i in `seq 1 $NUM_CLIENTS` | ||
26 | do | ||
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 | ||
32 | OFF="$END" | ||
33 | rm $1.$i.tmp | ||
34 | done | ||
35 | rm $1.tmp | ||