From 2053e448a7ee087673d3a29515923307d3004506 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Fri, 6 Aug 2010 11:15:37 +0300 Subject: [PATCH] ConfigFiles: add pre-run and post-run scripts-aware config file --- ConfigFiles/scenario-pre-post.r | 66 +++++++++++++++++++++++++++++++ ConfigFiles/scenario-pre-post.txt | 10 +++++ 2 files changed, 76 insertions(+) create mode 100644 ConfigFiles/scenario-pre-post.r create mode 100644 ConfigFiles/scenario-pre-post.txt diff --git a/ConfigFiles/scenario-pre-post.r b/ConfigFiles/scenario-pre-post.r new file mode 100644 index 0000000..906c1de --- /dev/null +++ b/ConfigFiles/scenario-pre-post.r @@ -0,0 +1,66 @@ +# +# 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() diff --git a/ConfigFiles/scenario-pre-post.txt b/ConfigFiles/scenario-pre-post.txt new file mode 100644 index 0000000..f8eed4f --- /dev/null +++ b/ConfigFiles/scenario-pre-post.txt @@ -0,0 +1,10 @@ +# Scenario01ct +# Description: +# * a flashcrowd swarm +# * 1 seeder +# * 89 leechers +# * all peers have the same bandwidth +# +# Hostname SSHport User RemoteFolder NetInterface Download(Mbps) DownloadBurst(K) Upload(Mbps) UploadBurst(K) TcScript ClientType TorrentFile Periods +p2p-next-01.grid.pub.ro 10122 p2p /home/p2p/george eth0 8 100 8 100 bw_limit_ct.sh hrktorrent_seeder Data.100M.ct.torrent (10,60) (60,100) (120,200) (200,230) (250,600) +p2p-next-01.grid.pub.ro 10322 p2p /home/p2p/george eth0 8 100 8 100 bw_limit_ct.sh hrktorrent_leecher Data.100M.ct.torrent (10,30) (40,70) (80,110) (130,160) (180,250) (300,600) -- 2.20.1