[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-tasks/master] Add graphing code for #6443.
commit 4e568b12507c575bd3c75f93e7c4aa97df38b4b1
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Mon Jul 23 14:17:42 2012 +0200
Add graphing code for #6443.
---
task-6443/README | 7 +++++++
task-6443/cumulated-weights.R | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/task-6443/README b/task-6443/README
new file mode 100644
index 0000000..5f10bdf
--- /dev/null
+++ b/task-6443/README
@@ -0,0 +1,7 @@
+Graph cdf of probability of selecting among the biggest k exits (#6443)
+
+- Run #5755 code to produce cumulated-weights.csv and
+ inverse-cumulated-weights.csv and copy those files to this directory.
+
+- Plot CDFs using: R --slave -f cumulated-weights.R
+
diff --git a/task-6443/cumulated-weights.R b/task-6443/cumulated-weights.R
new file mode 100755
index 0000000..50d0f4c
--- /dev/null
+++ b/task-6443/cumulated-weights.R
@@ -0,0 +1,35 @@
+require(ggplot2)
+require(scales)
+require(reshape)
+
+c <- read.csv("cumulated-weights.csv")
+c <- c[c$top_relays %in% c(1, 2, 3, 5, 10, 15, 20, 30, 50), ]
+c <- aggregate(list(total_exit_probability = c$total_exit_probability),
+ by = list(date = as.Date(c$validafter, origin = "1970-01-01 00:00:00"),
+ top_relays = c$top_relays), FUN = mean)
+ggplot(c, aes(x = date, y = total_exit_probability,
+ colour = as.factor(top_relays))) +
+geom_line() +
+scale_x_date(name = "") +
+scale_y_continuous(name = "Total exit probability of top-x relays\n",
+ limits = c(0, 1), labels = percent) +
+scale_colour_hue(name = "Top-x relays by exit probability") +
+opts(title = paste("Probability of selecting one of the top-x relays for",
+ "the exit position\n"), legend.position = "bottom")
+ggsave("exit-probability-cdf.png", width = 8, height = 5, dpi = 100)
+
+i <- read.csv("inverse-cumulated-weights.csv")
+i <- i[i$total_exit_probability > 0.1 & i$total_exit_probability < 0.9, ]
+i <- aggregate(list(top_relays = i$top_relays),
+ by = list(date = as.Date(i$validafter, origin = "1970-01-01 00:00:00"),
+ total_exit_probability = i$total_exit_probability), FUN = mean)
+ggplot(i, aes(x = date, y = top_relays,
+ colour = paste(100 * total_exit_probability, "%", sep = ""))) +
+geom_line() +
+scale_x_date(name = "") +
+scale_y_continuous(name = "Top-x relays by exit probability\n") +
+scale_colour_hue(name = "Total exit probability of top-x relays") +
+opts(title = paste("Number of relays making up the top-x for a given",
+ "total exit probability\n"), legend.position = "bottom")
+ggsave("exit-probability-icdf.png", width = 8, height = 5, dpi = 100)
+
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits