commit 895f005b1dd7ab73ca8b92c777f9d890c074e870 Author: Karsten Loesing karsten.loesing@gmx.net Date: Mon Jan 23 11:52:08 2012 +0100
Update #4686 graphing code. --- task-4686/.gitignore | 4 ++-- task-4686/download-stats.R | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/task-4686/.gitignore b/task-4686/.gitignore index 23b548f..2691567 100644 --- a/task-4686/.gitignore +++ b/task-4686/.gitignore @@ -1,4 +1,4 @@ Rplots.pdf -download-stats.csv -download-stats.png +*.csv +*.png
diff --git a/task-4686/download-stats.R b/task-4686/download-stats.R index bdc599c..bd4f065 100644 --- a/task-4686/download-stats.R +++ b/task-4686/download-stats.R @@ -1,13 +1,21 @@ library(ggplot2) -d <- read.csv("download-stats.csv", header = FALSE, + +u <- read.csv("download-stats-usa.csv", header = FALSE, + col.names = c("dirauth", "download", "seconds")) +e <- read.csv("download-stats-europe.csv", header = FALSE, col.names = c("dirauth", "download", "seconds")) +d <- rbind( + data.frame(u, host = "U.S.A."), + data.frame(e, host = "Europe")) +d <- d[d$download >= min(e$download), ] ggplot(d, aes(x = as.POSIXct(download / 1000, - origin = "1970-01-01 00:00:00"), y = seconds / 1000)) + + origin = "1970-01-01 00:00:00"), y = seconds / 1000, colour = host)) + geom_point(alpha = 0.25) + facet_wrap(~ dirauth) + -scale_x_datetime(name = "", major = "1 month", minor = "1 week", - format = "%b %d, %Y") + +scale_x_datetime(name = "", major = "1 week", minor = "1 day", + format = "%b %d") + scale_y_continuous(name = "", limits = c(0, max(d$seconds) / 1000)) + +scale_colour_hue(name = "") + opts(title = "Consensus download times in seconds\n") -ggsave("download-stats.png", width = 8, height = 6, dpi = 100) +ggsave("download-stats-comparison.png", width = 8, height = 6, dpi = 100)