[tor-commits] [metrics-tasks/master] Update #6443 graphing code.

karsten at torproject.org karsten at torproject.org
Fri Jul 27 11:54:44 UTC 2012


commit b1b7d5adae31f49ecabf3fb2c41c2e68819335a2
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Jul 27 13:49:19 2012 +0200

    Update #6443 graphing code.
---
 task-6443/cumulated-weights.R |   53 ++++++++++++++++++++++++++++++++++++++++-
 task-6443/run.sh              |    2 +-
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/task-6443/cumulated-weights.R b/task-6443/cumulated-weights.R
index 811564b..11458b4 100755
--- a/task-6443/cumulated-weights.R
+++ b/task-6443/cumulated-weights.R
@@ -19,8 +19,10 @@ v <- c(
   format((v[v <= week])[1], usetz = FALSE),
   format(now, usetz = FALSE))
 v <- cw[cw$validafter %in% v, ]
+v <- v[v$weight_type == "consensus weights", c(1, 3, 4)]
 v <- data.frame(x = v$top_relays, y = v$total_exit_probability,
-  colour = factor(v$validafter, levels = rev(levels(factor(v$validafter)))))
+  colour = factor(v$validafter,
+  levels = rev(levels(factor(v$validafter)))))
 ggplot(v, aes(x = x, y = y, colour = colour)) +
 geom_point() +
 geom_line() +
@@ -69,3 +71,52 @@ opts(title = paste("Number of relays making up the top-x for a given",
   "total exit probability\n"), legend.position = "bottom")
 ggsave("exit-probability-cdf-c.png", width = 8, height = 5, dpi = 100)
 
+v <- cw
+max_validafter <- max(v$validafter)
+v <- v[v$validafter == max_validafter, ]
+ggplot(v, aes(x = top_relays, y = total_exit_probability,
+  colour = weight_type)) +
+geom_point() +
+geom_line() +
+scale_x_continuous(name = "\nTop-x relays by exit probability") +
+scale_y_continuous(name = "Total exit probability\n", labels = percent) +
+scale_colour_hue(name = "") +
+opts(title = paste("Probability of selecting one of the top-x relays\nfor",
+  "the exit position on", strftime(max_validafter, format = "%B %d, %Y")),
+  legend.position = "top")
+ggsave("exit-probability-cdf-d.png", width = 8, height = 5, dpi = 100)
+
+c <- cw
+c <- c[c$top_relays == 10, ]
+c <- aggregate(list(total_exit_probability = c$total_exit_probability),
+  by = list(date = as.Date(cut.Date(as.Date(c$validafter,
+  origin = "1970-01-01 00:00:00"), "week")),
+  weight_type = c$weight_type), FUN = mean)
+ggplot(c, aes(x = date, y = total_exit_probability,
+  colour = as.factor(weight_type))) +
+geom_line() +
+scale_x_date(name = "") +
+scale_y_continuous(name = "Total exit probability of top-10 relays\n",
+  #limits = c(0, 1), labels = percent) +
+  labels = percent) +
+scale_colour_hue(name = "") +
+opts(title = paste("Probability of selecting one of the top-10 relays for",
+  "the exit position"), legend.position = "top")
+ggsave("exit-probability-cdf-e.png", width = 8, height = 5, dpi = 100)
+
+i <- iw
+i <- i[i$total_exit_probability == factor(0.5), ]
+i <- aggregate(list(top_relays = i$top_relays),
+  by = list(date = as.Date(cut.Date(as.Date(i$validafter,
+  origin = "1970-01-01 00:00:00"), "week")),
+  weight_type = i$weight_type), FUN = mean)
+ggplot(i, aes(x = date, y = top_relays,
+  colour = weight_type)) +
+geom_line() +
+scale_x_date(name = "") +
+scale_y_continuous(name = "Top-x relays by exit probability\n") +
+scale_colour_hue(name = "") +
+opts(title = paste("Number of relays making up the top-x for 50%",
+  "total exit probability"), legend.position = "top")
+ggsave("exit-probability-cdf-f.png", width = 8, height = 5, dpi = 100)
+
diff --git a/task-6443/run.sh b/task-6443/run.sh
index 8ea016e..7a88306 100755
--- a/task-6443/run.sh
+++ b/task-6443/run.sh
@@ -1,3 +1,3 @@
 #!/bin/bash
-javac -d bin -cp lib/descriptor.jar src/CalculatePathSelectionProbabilities.java && java -cp bin:lib/descriptor.jar:lib/commons-codec-1.6.jar:lib/commons-compress-1.4.1.jar CalculatePathSelectionProbabilities
+javac -d bin -cp lib/descriptor.jar src/CalculatePathSelectionProbabilities.java && java -Xmx2g -cp bin:lib/descriptor.jar:lib/commons-codec-1.6.jar:lib/commons-compress-1.4.1.jar CalculatePathSelectionProbabilities
 



More information about the tor-commits mailing list