-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9febf9
commit 7be61dc
Showing
5 changed files
with
280 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
#collect the number of requests serviced over the course of the execution | ||
|
||
#collect bandwidth measure now that the script is done | ||
last=`tail -1 bandwidth.txt` | ||
echo "" > bandwidth.dat | ||
echo $last | ||
for(( i=1 ; 1 < last ; i++)); do | ||
c=`grep -c "^$i$" bandwidth.txt` | ||
if [ "$i" == "$last" ]; then | ||
break | ||
fi | ||
echo "$i, $c" >> bandwidth.dat | ||
done | ||
|
||
cp bandwidth.dat govectorEval/instrumentedBandwidth.dat | ||
#cp bandwidth.dat govectorEval/unmodifiedBandwidth.dat | ||
|
||
cp latency.dat govectorEval/instrumentedLatency.dat | ||
#cp latency.dat govectorEval/unmodifiedLatency.dat | ||
|
||
R CMD BATCH summary.R | ||
cat summary.Rout | ||
|
||
gnuplot bandwidth.plot | ||
evince bandwidth.pdf | ||
|
||
|
||
gnuplot latency.plot | ||
evince latency.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#/!usr/bin/env Rscript | ||
uninstlat <-read.table("./govectorEval/unmodifiedLatency.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
instlat <-read.table("./govectorEval/instrumentedLatency.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
uninstband <-read.table("./govectorEval/unmodifiedBandwidth.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
instband <-read.table("./govectorEval/instrumentedBandwidth.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
|
||
|
||
print("unmodified latency") | ||
summary(uninstlat) | ||
|
||
print("instrumented latency") | ||
summary(instlat) | ||
|
||
print("unmodified bandwidth") | ||
summary(uninstband) | ||
|
||
print("instrumented bandwidth") | ||
summary(instband) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" | ||
Copyright (C) 2013 The R Foundation for Statistical Computing | ||
Platform: x86_64-pc-linux-gnu (64-bit) | ||
|
||
R is free software and comes with ABSOLUTELY NO WARRANTY. | ||
You are welcome to redistribute it under certain conditions. | ||
Type 'license()' or 'licence()' for distribution details. | ||
|
||
Natural language support but running in an English locale | ||
|
||
R is a collaborative project with many contributors. | ||
Type 'contributors()' for more information and | ||
'citation()' on how to cite R or R packages in publications. | ||
|
||
Type 'demo()' for some demos, 'help()' for on-line help, or | ||
'help.start()' for an HTML browser interface to help. | ||
Type 'q()' to quit R. | ||
|
||
[Previously saved workspace restored] | ||
|
||
> #/!usr/bin/env Rscript | ||
> uninstlat <-read.table("./govectorEval/unmodifiedLatency.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
> instlat <-read.table("./govectorEval/instrumentedLatency.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
> uninstband <-read.table("./govectorEval/unmodifiedBandwidth.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
> instband <-read.table("./govectorEval/instrumentedBandwidth.dat", header=TRUE, sep=",", na.strings="NA", dec=".", strip.white=TRUE) | ||
> | ||
> | ||
> print("unmodified latency") | ||
[1] "unmodified latency" | ||
> summary(uninstlat) | ||
X172384821 X24 | ||
Min. :1.872e+08 Min. : 19.00 | ||
1st Qu.:4.980e+09 1st Qu.: 29.00 | ||
Median :1.002e+10 Median : 35.00 | ||
Mean :1.007e+10 Mean : 42.57 | ||
3rd Qu.:1.503e+10 3rd Qu.: 50.00 | ||
Max. :1.999e+10 Max. :284.00 | ||
> | ||
> print("instrumented latency") | ||
[1] "instrumented latency" | ||
> summary(instlat) | ||
X1724258727 X0 | ||
Min. :1.894e+09 Min. :0 | ||
1st Qu.:3.768e+09 1st Qu.:0 | ||
Median :5.725e+09 Median :0 | ||
Mean :5.741e+09 Mean :0 | ||
3rd Qu.:7.558e+09 3rd Qu.:0 | ||
Max. :9.920e+09 Max. :0 | ||
> | ||
> print("unmodified bandwidth") | ||
[1] "unmodified bandwidth" | ||
> summary(uninstband) | ||
X1 X0 | ||
Min. : 2.00 Min. : 0.0 | ||
1st Qu.:16.25 1st Qu.:120.0 | ||
Median :30.50 Median :134.0 | ||
Mean :30.50 Mean :128.0 | ||
3rd Qu.:44.75 3rd Qu.:150.8 | ||
Max. :59.00 Max. :175.0 | ||
> | ||
> print("instrumented bandwidth") | ||
[1] "instrumented bandwidth" | ||
> summary(instband) | ||
X1 X0 | ||
Min. :2.00 Min. :5.0 | ||
1st Qu.:3.75 1st Qu.:7.5 | ||
Median :5.50 Median :8.0 | ||
Mean :5.50 Mean :7.5 | ||
3rd Qu.:7.25 3rd Qu.:8.0 | ||
Max. :9.00 Max. :9.0 | ||
> | ||
> | ||
> proc.time() | ||
user system elapsed | ||
0.233 0.044 1.043 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
#!/bin/bash | ||
|
||
nodes=5 | ||
startingport=6000 | ||
trackerport=6011 | ||
nodesWithFiles=2 | ||
nodePID=() | ||
|
||
#testDir=~/go/src/github.com/nictuku/dht/examples/find_infohash_and_wait | ||
testDir=~/go/src/bitbucket.org/bestchai/dinv/experiements/nictuku-dht | ||
dinvDir=~/go/src/bitbucket.org/bestchai/dinv | ||
|
||
|
||
torrentFolder=torrents | ||
|
||
#torrentFile=12am.torrent | ||
#realfile=12am.mp3 | ||
torrentFile=speech.torrent | ||
realfile=speech.mp3 | ||
|
||
function install { | ||
echo "installing dinv" | ||
cd ~/go/src/bitbucket.org/bestchai/dinv | ||
sudo -E go install | ||
echo "installing DHT" | ||
cd ~/go/src/github.com/nictuku/dht | ||
sudo -E go install | ||
} | ||
|
||
function createDirs { | ||
cd $testDir | ||
for (( i=0; i<$nodes; i++ )) | ||
do | ||
mkdir c$i | ||
#give the torrent file to a subset of clients | ||
if [ $i -lt $nodesWithFiles ] | ||
then | ||
cp $torrentFolder/$torrentFile c$i | ||
cp $torrentFolder/$realfile c$i | ||
else | ||
cp $torrentFolder/$torrentFile c$i | ||
fi | ||
done | ||
} | ||
|
||
function run { | ||
cd $testDir | ||
sleep 1 | ||
#start the clients | ||
for (( i=0; i<$nodes; i++)) | ||
do | ||
sleep 1 | ||
#go run main.go --port=600$i -logtostderr -v 5 | ||
#go run main.go --port=600$i -logtostderr -v 5 & | ||
gnome-terminal -x go run main.go --port=600$i -logtostderr -v 5 | ||
#go run main.go --port=600$i & | ||
done | ||
|
||
sleep 10 | ||
killem | ||
|
||
} | ||
|
||
function moveResults { | ||
for (( i=0; i<$nodes; i++)) | ||
do | ||
cd $testDir/c$i | ||
mv *[dg].txt .. | ||
done | ||
cd $testDir | ||
wc *.txt | ||
} | ||
|
||
function merge { | ||
cd $testDir | ||
dinv -l -plan=SCM -shiviz *g.txt *d.txt | ||
} | ||
|
||
function daikon { | ||
cd $testDir | ||
for file in ./*.dtrace; do | ||
java daikon.Daikon $file | ||
done | ||
} | ||
|
||
|
||
|
||
#cleanup functions | ||
function removeDirs { | ||
cd $testDir | ||
rm -r c* | ||
} | ||
|
||
|
||
function cleanup { | ||
removeDirs | ||
killem | ||
$dinvDir/examples/lib.sh clean | ||
} | ||
|
||
function killem { | ||
killall go | ||
killall main | ||
} | ||
|
||
|
||
|
||
if [ "$1" == "-c" ]; | ||
then | ||
cleanup | ||
exit | ||
fi | ||
|
||
if [ "$1" == "-k" ]; | ||
then | ||
killem | ||
exit | ||
fi | ||
|
||
if [ "$1" == "-d" ]; | ||
then | ||
install | ||
run | ||
#moveResults | ||
merge | ||
daikon | ||
fi | ||
|
||
if [ "$1" == "-m" ]; | ||
then | ||
merge | ||
daikon | ||
fi | ||
|
||
exit |