gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: add shell script to convert


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: add shell script to convert result of zonewalk to input for gnunet-gns-benchmark
Date: Sun, 13 May 2018 16:40:20 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new f69c5e059 add shell script to convert result of zonewalk to input for 
gnunet-gns-benchmark
f69c5e059 is described below

commit f69c5e0593e0115e48d7a3138f64c183757f6066
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun May 13 16:40:18 2018 +0200

    add shell script to convert result of zonewalk to input for 
gnunet-gns-benchmark
---
 contrib/zonewalk-to-types.sh | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/contrib/zonewalk-to-types.sh b/contrib/zonewalk-to-types.sh
new file mode 100755
index 000000000..c5096e695
--- /dev/null
+++ b/contrib/zonewalk-to-types.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# This script is in the public domain.
+# Converts the output of gnunet-zonewalk (DNS resolutions)
+# into a proper input for gnunet-gns-benchmark.
+
+NUM_CLIENTS=3
+# How many different groups of names should we
+# create?  1/N will be in the 'shared' group.
+
+# FILE ($1) contains results from DNS lookup; strip
+# everything but the hostnames, remove duplicates
+# and then randomize the order.
+cat $1 | awk '{print $1}' | sort | uniq | shuf > $1.tmp
+TOTAL=`cat $1.tmp | wc -l`
+GROUP_SIZE=`expr $TOTAL / \( $NUM_TYPES + 1 \)`
+
+# First group (0) is to be shared among all clients
+for i in `seq 1 $NUM_CLIENTS`
+do
+  cat $1.tmp | head -n $GROUP_SIZE | awk "{print 0 \" \" \$1}" > $1.$i.tmp
+done
+
+# Second group (1) is unique per client
+OFF=0
+for i in `seq 0 $NUM_CLIENTS`
+do
+  END=`expr $OFF + $GROUP_SIZE`
+  cat $1.tmp | head -n $END | tail -n $GROUP_SIZE | awk "{print 1 \" \" \$1}" 
>> $1.$i.tmp
+# Shuffle again, so we mix the different request categories in terms of
+# when we issue the queries.
+  cat $1.$i.tmp | shuf > $1.$i
+  OFF="$END"
+  rm $1.$i.tmp
+done
+rm $1.tmp

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]