# start/stop/detect scripts
#
-# Read scenarion configuration file
-source ${BASE_PATH}/ClientWorkingFolders/TmpLogs/scenario_config
+DEBUG()
+{
+ test ${_DEBUG} = "on" && $@
+}
start_client()
{
+ local client_type=$1
+
DEBUG echo "starting client ..."
- case "${CLIENT_TYPE}" in
+ case "${client_type}" in
"hrktorrent_seeder")
./start_hrk_seeder.sh &
return $!
stop_client()
{
- local CLIENT_TYPE=$1
+ local client_type=$1
DEBUG echo "stopping client ..."
case "${CLIENT_TYPE}" in
detect_complete_client()
{
- local log_file=$1
+ local client_type=$1
+ local log_file=$2
DEBUG echo "stopping client ..."
- case "${CLIENT_TYPE}" in
+ case "${client_type}" in
"hrktorrent_seeder")
./detect_complete_hrk.sh ${log_file}
;;
parse_client_log()
{
- local log_folder=$1
- local log_file=$2
+ local client_type=$1
+ local log_folder=$2
+ local log_file=$3
- DEBUG echo "stopping client ..."
- case "${CLIENT_TYPE}" in
+ DEBUG echo "parsing client ${client_type} (${log_folder}/${log_file})..."
+ case "${client_type}" in
"hrktorrent_seeder")
+ DEBUG echo "hello hrktorrent_seeder"
./parse_hrk.sh ${log_folder} ${log_file}
;;
"hrktorrent_leecher")
+ DEBUG echo "hello hrktorrent_leecher"
./parse_hrk.sh ${log_folder} ${log_file}
;;
esac
--- /dev/null
+#
+# Copyright: George Milescu 2010 - george.milescu@gmail.com
+#
+# R script used to plot the results of a scenario
+
+# import ggplot2
+library(ggplot2)
+
+# Read transmitted command line arguments
+args <- commandArgs(trailingOnly = TRUE)
+
+# The data files are located in the target folder. Also, the graph will be saved in the target folder.
+target_folder <- args[2]
+campaign_name <- args[3]
+rm(args)
+
+# read data from the data file
+seeder=read.table(paste(target_folder, "p2p-next-01-101.log.data", sep="/"), header=T, sep=" ")
+leecher=read.table(paste(target_folder, "p2p-next-01-103.log.data", sep="/"), header=T, sep=" ")
+
+
+# transform KB/s to Mbit/s
+leecher$dlspeed <- leecher$dlspeed*8/1000
+
+
+# plot dlspeed-percent data
+p <- ggplot() +
+geom_point(aes(x=leecher$percent, y=leecher$dlspeed, label="Leecher"), size=1) +
+theme_bw() +
+scale_x_continuous("Percent", limits=c(0, 100), breaks=seq(0, 100, 10)) +
+scale_y_continuous("Download speed (Mbit/s)", limits=c(0, 8), breaks=seq(0, 8, 0.5)) +
+coord_cartesian() +
+scale_colour_manual("Legend") +
+opts(title=paste(campaign_name, "Scenario-rd: a test swarm (1 Seeder, 1 Leecher), all peers have an 8 Mbit/s BW", sep="\n"))
+
+# plot data as an eps file
+postscript(paste(target_folder, "scenario-rd-dlspeed-percent.eps", sep="/"))
+print(p)
+dev.off()
+
+# plot data as an png file
+png(paste(target_folder, "scenario-rd-dlspeed-percent.png", sep="/"), width = 1280, height = 800)
+print(p)
+dev.off()
+
+
+
+# plot dlspeed-time data
+p <- ggplot() +
+geom_point(aes(x=leecher$time, y=leecher$dlspeed, label="Leecher"), size=1) +
+theme_bw() +
+scale_x_continuous("Time(s)") +
+scale_y_continuous("Download speed (Mbit/s)", limits=c(0, 8), breaks=seq(0, 8, 0.5)) +
+coord_cartesian() +
+scale_colour_manual("Legend") +
+opts(title=paste(campaign_name, "Scenario-rd: a test swarm (1 Seeder, 1 Leecher), all peers have an 8 Mbit/s BW", sep="\n"))
+
+# plot data as an eps file
+postscript(paste(target_folder, "scenario-rd-dlspeed-time.eps", sep="/"))
+print(p)
+dev.off()
+
+# plot data as an png file
+png(paste(target_folder, "scenario-rd-dlspeed-time.png", sep="/"), width = 1280, height = 800)
+print(p)
+dev.off()
--- /dev/null
+# Scenario01ct
+# Description:
+# * 1 seeder
+# * 1 leecher
+# * client-wise limitation
+#
+# Hostname SSHport User RemoteFolder NetInterface Download(Mbps) DownloadBurst(K) Upload(Mbps) UploadBurst(K) PreRunScript PostRunScript ClientType TorrentFile Periods
+p2p-next-03.grid.pub.ro 10122 p2p /home/p2p/george eth0 8 100 8 100 pre-run_nop.sh post-run_nop.sh hrktorrent_seeder Data.100M.ct.torrent (10,60) (60,100) (120,200) (200,230) (250,600)
+p2p-next-03.grid.pub.ro 10222 p2p /home/p2p/george eth0 8 100 8 100 pre-run_nop.sh post-run_nop.sh hrktorrent_leecher Data.100M.ct.torrent (10,30) (40,70) (80,110) (130,160) (180,250) (300,600)