[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [metrics/master] Add directory archives R script, too.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Wed, 1 Jul 2009 20:42:27 +0200
Subject: Add directory archives R script, too.
Commit: e271234e1e1682875f789145ca5944468e2c13a0
---
scripts/dirarch/dirarch.R | 164 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 164 insertions(+), 0 deletions(-)
create mode 100644 scripts/dirarch/dirarch.R
diff --git a/scripts/dirarch/dirarch.R b/scripts/dirarch/dirarch.R
new file mode 100644
index 0000000..54ed338
--- /dev/null
+++ b/scripts/dirarch/dirarch.R
@@ -0,0 +1,164 @@
+r <- read.csv("out/dirarch/relayflags.csv")
+r <- r[1:length(r$running)-1,]
+pdf("report/dirarch/relayflags.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 3.7))
+plot(r$running, type="l", ylim=c(0, max(na.omit(r$running))), frame=FALSE, axes=FALSE, col="black", xlab="Date", ylab="Running relays", main="Relay statuses")
+lines(r$exit, type="l", col="orange")
+lines(r$fast, type="l", col="red")
+lines(r$guard, type="l", col="blue")
+lines(c(rep(NA,643),r$hsdir[644:length(r$hsdir)]), type="l", col="darkred")
+lines(r$stable, type="l", col="purple")
+lines(r$v2dir, type="l", col="darkgreen")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M",""), tick=FALSE, line=-1.1, cex.axis=0.5)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(r$running)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+mtext("Total", side=4, las=1, at=r$running[length(r$running)])
+mtext("Exit", side=4, las=1, at=r$exit[length(r$running)], col="orange")
+mtext("Fast", side=4, las=1, at=r$fast[length(r$running)], col="red")
+mtext("Guard", side=4, las=1, at=r$guard[length(r$running)], col="blue")
+mtext("HSDir", side=4, las=1, at=r$hsdir[length(r$running)], col="darkred")
+mtext("Stable", side=4, las=1, at=r$stable[length(r$running)]+40, col="purple")
+mtext("V2Dir", side=4, las=1, at=r$v2dir[length(r$running)]-5, col="darkgreen")
+par(oldpar)
+dev.off();
+
+p <- read.csv("out/dirarch/platforms.csv")
+pdf("report/dirarch/platforms.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 0))
+plot(c(rep(NA,61),p$v012[62:length(p$v012)]), type="l", ylim=c(0, max(na.omit(p$v012))), frame=FALSE, axes=FALSE, col="orange", xlab="Date", ylab="Running relays", main="Relay versions")
+lines(p$v010, type="l", col="purple")
+lines(p$v011, type="l", col="red")
+lines(c(rep(NA,389),p$v020[390:length(p$v020)]), type="l", col="darkgreen")
+lines(c(rep(NA,748),p$v021[749:length(p$v021)]), type="l", col="blue")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M",""), tick=FALSE, line=-1.1, cex.axis=0.6)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(p$v012)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+text(50, 415, labels="0.1.0.x")
+text(325, 840, labels="0.1.1.x")
+text(830, 1220, labels="0.1.2.x")
+text(1000, 820, labels="0.2.0.x")
+text(1000, 150, labels="0.2.1.x")
+par(oldpar)
+dev.off();
+
+a <- read.csv("out/dirarch/advertised.csv")
+factor <- 2^20
+pdf("report/dirarch/advertised.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 3.7))
+plot(a$observed/factor, type="l", ylim=c(0, max(na.omit(a$observed))/factor), frame=FALSE, axes=FALSE, col="darkgreen", xlab="Date", ylab="Bandwidth [MB/s]", main="Relay bandwidths")
+lines((a$routerbw+a$extrabw)/900/factor, type="l", col="red")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M", ""), tick=FALSE, line=-1.1, cex.axis=0.5)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(a$observed)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+mtext("Observed", side=4, las=1, at=a$observed[length(a$observed)]/factor)
+mtext("History", side=4, las=1, at=(a$routerbw[length(a$routerbw)]+a$extrabw[length(a$extrabw)])/900/factor)
+par(oldpar)
+dev.off();
+
+d <- read.csv("out/dirarch/dynamic.csv")
+pdf("report/dirarch/dynamic.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 0.1))
+plot(d$ip1+d$ip2, type="l", ylim=c(0, max(na.omit(d$ip1+d$ip2))), frame=FALSE, axes=FALSE, col="darkgreen", xlab="Date", ylab="Running relays", main="Relays on dynamic IP addresses")
+lines(d$ip3to5+d$ip6to10+d$ip11ormore, type="l", col="orange")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J"), tick=FALSE, line=-1.1, cex.axis=0.6)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(d$ip1)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+text(length(d$total), 1000, labels="Static IP address", pos=2)
+text(length(d$total), 380, labels="Dynamic IP address", pos=2)
+par(oldpar)
+dev.off();
+
+d <- read.csv("out/dirarch/dynamic-cutoff.csv")
+pdf("report/dirarch/dynamic-cutoff.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 3.7))
+plot(d$count, type="b", xlim=c(1,10), xlab="Distinct IP addresses seen between Feb 2006 and Jun 2009", ylab="Running relays", main="Distinct IP addresses per relay", frame=FALSE, axes=FALSE, col="blue")
+abline(v = 2.5, lty = 2)
+text(x = 2.5, y = 200, pos = 4, "cutoff between static and dynamic addresses")
+axis(1, at=1:10)
+axis(2)
+par(oldpar)
+dev.off();
+
+c <- read.csv("out/dirarch/country.csv")
+####sort(apply(c, 2, mean), decreasing = TRUE)[2:6]
+pdf("report/dirarch/country.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 4.6))
+plot(c$DE, type="l", ylim=c(0, max(na.omit(c$DE))), frame=FALSE, axes=FALSE, xlab="Date", ylab="Running relays", main="Relay locations", col="orange")
+lines(c$US, type="l", col="blue")
+lines(c$FR, type="l", col="darkgreen")
+lines(c$CN, type="l", col="red")
+lines(c$SE, type="l", col="purple")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M",""), tick=FALSE, line=-1.1, cex.axis=0.5)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(c$DE)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+mtext("Germany", side=4, las=1, at=c$DE[length(c$total)] + 7, col="orange")
+mtext("U.S.A.", side=4, las=1, at=c$US[length(c$total)] - 5, col="blue")
+mtext("France", side=4, las=1, at=c$FR[length(c$total)] + 5, col="darkgreen")
+mtext("Sweden", side=4, las=1, at=c$SE[length(c$total)] + 5, col="purple")
+mtext("China", side=4, las=1, at=c$CN[length(c$total)] - 2, col="red")
+par(oldpar)
+dev.off();
+
+c <- read.csv("out/dirarch/countrybw.csv", stringsAsFactors = FALSE)
+factor <- 2^20 * 900
+pdf("report/dirarch/countrybw.pdf", width=8, height=6)
+oldpar <- par(mar=c(4.1, 3.9, 1.4, 4.6))
+plot(c$tDE/factor, type="l", ylim=c(0, max(na.omit(c$tDE))/factor), frame=FALSE, axes=FALSE, xlab="Date", ylab="Bandwidth [MB/s]", main="Relay locations", col="orange")
+#DE, US, NL, FR, SE, AT, GR, DK, CN, IT
+lines(c$tUS/factor, type="l", col="blue")
+lines(c$tNL/factor, type="l", col="cyan")
+lines(c$tFR/factor, type="l", col="darkgreen")
+lines(c$tSE/factor, type="l", col="purple")
+axis(1, at=c(328, 693, 1059), labels=FALSE, lwd=0.8)
+monthticks <- c(22, 53, 83, 114, 144, 175, 206, 236, 267, 297, 328, 359, 387, 418, 448, 479, 509, 540, 571, 601, 632, 662, 693, 724, 753, 784, 814, 845, 875, 906, 937, 967, 998, 1028, 1059, 1090, 1118, 1149, 1179, 1209)
+axis(1, at=monthticks, labels=FALSE, lwd=0.8, tcl=-0.1)
+axis(1, at=monthticks + 15, labels=c("M","A","M","J","J","A","S","O","N","D", "J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M","J","J","A","S","O","N","D",
+"J","F","M","A","M",""), tick=FALSE, line=-1.1, cex.axis=0.5)
+axis(1, at=c(328-183, 328+182, 693+182, 1059+120), labels=c("2006", "2007", "2008", "2009"), tick=FALSE)
+parside <- { flip <- 1; xaxis <- TRUE; islog <- FALSE; otherlog <- FALSE; 3 }
+lines(c(1,length(c$tDE)),rep(par("usr")[parside],2), xpd=TRUE)
+axis(2)
+mtext("Germany", side=4, las=1, at=c$tDE[length(c$ttotal)]/factor+1, col="orange")
+mtext("U.S.A.", side=4, las=1, at=c$tUS[length(c$ttotal)]/factor-1, col="blue")
+mtext("France", side=4, las=1, at=c$tFR[length(c$ttotal)]/factor-1, col="darkgreen")
+mtext("Sweden", side=4, las=1, at=c$tSE[length(c$ttotal)]/factor+1, col="purple")
+mtext("Netherlands", side=4, las=1, at=c$tNL[length(c$ttotal)]/factor, col="cyan")
+par(oldpar)
+dev.off();
+
--
1.5.6.5