Utils: a new script named publish_time_dl_speed_for_more_campaings was added which...
authorP2P-Next User <p2p@p2p-next-04-201.grid.pub.ro>
Sat, 13 Nov 2010 21:04:33 +0000 (23:04 +0200)
committerP2P-Next User <p2p@p2p-next-04-201.grid.pub.ro>
Sat, 13 Nov 2010 21:04:33 +0000 (23:04 +0200)
Utils/publish_time_dl_speed
Utils/publish_time_dl_speed_for_more_campaigns [new file with mode: 0755]

index f802305..d1d1033 100755 (executable)
@@ -1 +1,10 @@
-for i in $(find ../Results/tsup-1t-2-2010.11.11-08.20.53/ -mindepth 1 -mindepth 1 -type d); do ./get_time_dl_speed_avg_for_swarm $i > $i/time_dl_speed_avg.data; done
+#!/bin/bash
+
+if [ $# -lt 1 ]; then
+       echo "usage: $0 campaign_path"
+       exit 1
+fi
+
+for i in $(find $1 -mindepth 1 -maxdepth 1 -type d); do 
+       ./get_time_dl_speed_avg_for_swarm $i > $i/time_dl_speed_avg.data
+done
diff --git a/Utils/publish_time_dl_speed_for_more_campaigns b/Utils/publish_time_dl_speed_for_more_campaigns
new file mode 100755 (executable)
index 0000000..8083f95
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Copyright 2010, Calin-Andrei Burloiu, calin.burloiu@gmail.com
+#
+# This script calculates the average download time and average download speed for each common scenario from more campaigns, merging the results from more campaign experiments. The first argument is the destination folder for the results and the rest of them are the folders where the input campaigns are located. In order to merge the results, the coresponding scenarios from each campaign must have the same names.
+#
+
+if [ $# -lt 2 ]; then
+       echo "usage: $0 dest_path campaign01_path [campaign02_path] ..."
+       exit 1
+fi
+
+if [ ! -e $1 ]; then
+       mkdir $1
+fi
+
+first=1
+# for each campaign listed in the args
+for i in $@; do
+       if [ $first -eq 1 ]; then
+               first=0
+               continue
+       fi
+       
+       # for each scenario of the campaign
+       for j in $(find $i -mindepth 1 -maxdepth 1 -type d); do 
+               dest=$1/${j##*/}
+               if [ ! -e $dest ]; then
+                       mkdir $dest
+               fi
+               ./get_time_dl_speed_avg_for_swarm $j >> $dest/time_dl_speed_avg_for_each.data
+       done
+done
+
+# for each destination directory
+for j in $(find $1 -mindepth 1 -maxdepth 1 -type d); do 
+       (./avg2 < $j/time_dl_speed_avg_for_each.data) > $j/time_dl_speed_avg_for_all.data
+done