[or-cvs] r15205: Code for plotting simple statistics (projects/hidserv/trunk)

sjm217 at seul.org sjm217 at seul.org
Fri Jun 13 11:44:32 UTC 2008


Author: sjm217
Date: 2008-06-13 07:44:32 -0400 (Fri, 13 Jun 2008)
New Revision: 15205

Added:
   projects/hidserv/trunk/plot.R
Log:
Code for plotting simple statistics

Added: projects/hidserv/trunk/plot.R
===================================================================
--- projects/hidserv/trunk/plot.R	                        (rev 0)
+++ projects/hidserv/trunk/plot.R	2008-06-13 11:44:32 UTC (rev 15205)
@@ -0,0 +1,42 @@
+###
+### Plot some simple statistics on hidden service measurements
+###
+### Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
+###
+### $Id:$
+###
+
+conntime <- read.csv("conntime.csv",header=TRUE,
+ comment.char="#",colClasses=c("factor","numeric","numeric"))
+publtime <- read.csv("publtime.csv",header=TRUE,
+ comment.char="#",colClasses=c("factor","numeric"))
+reqtimes <- read.csv("reqtimes.csv",header=TRUE,
+ comment.char="#",colClasses=c("factor","numeric"))
+restimes <- read.csv("restimes.csv",header=TRUE,
+ comment.char="#",colClasses=c("factor","numeric"))
+
+h <- function(v, n, fn) {
+  v <- v/1e3
+  
+  print(n)
+  print(summary(v))
+
+  sv <- na.omit(v)
+  len <- length(sv)
+  sv <- sort(sv)
+
+  plotmax <- sv[len*0.99]
+  plotmin <- sv[1]
+
+  sv[sv<plotmin | sv>plotmax] <- NA
+  
+  png(paste(fn, "png", sep="."), width=800, height=600)
+  hist(sv, breaks=100, main=n, xlim=c(plotmin, plotmax), xlab="Time (s)")
+  dev.off()
+}
+
+h(conntime$opentime, "Connection opening time", "opentime")
+h(conntime$duration, "Connection duration", "duration")
+h(publtime$publtime, "Publication time", "publtime")
+h(reqtimes$reqtime, "Request time", "reqtime")
+h(restimes$restime, "Response time", "restime")


Property changes on: projects/hidserv/trunk/plot.R
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the tor-commits mailing list