From 9ff3b4f575c8a8d9a2de4097e5628c8f3ff198af Mon Sep 17 00:00:00 2001 From: P2P-Next User Date: Sat, 13 Nov 2010 23:04:33 +0200 Subject: [PATCH] Utils: a new script named publish_time_dl_speed_for_more_campaings was added which merges the results from more experiment campaigns --- Utils/publish_time_dl_speed | 11 +++++- .../publish_time_dl_speed_for_more_campaigns | 38 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 Utils/publish_time_dl_speed_for_more_campaigns diff --git a/Utils/publish_time_dl_speed b/Utils/publish_time_dl_speed index f802305..d1d1033 100755 --- a/Utils/publish_time_dl_speed +++ b/Utils/publish_time_dl_speed @@ -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 index 0000000..8083f95 --- /dev/null +++ b/Utils/publish_time_dl_speed_for_more_campaigns @@ -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 -- 2.20.1