[tor-commits] [metrics-tasks/master] Add another graph for #3277.

karsten at torproject.org karsten at torproject.org
Wed May 25 06:02:36 UTC 2011


commit a7ad71b01533b64e2d5e0b9c4f0f8f63d8d2a593
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed May 25 08:02:13 2011 +0200

    Add another graph for #3277.
---
 task-3277/hsdir-sessions.R |   38 ++++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/task-3277/hsdir-sessions.R b/task-3277/hsdir-sessions.R
index 4b28131..51633f5 100644
--- a/task-3277/hsdir-sessions.R
+++ b/task-3277/hsdir-sessions.R
@@ -7,10 +7,28 @@ data <- read.csv("hsdir-sessions.csv", stringsAsFactors = FALSE)
 #scale_x_continuous(limits = c(0, 72)) +
 #scale_y_continuous(formatter = "percent")
 
-data <- sort(data$duration)
-data <- data.frame(x = data / (60 * 60),
-  y = (length(data):1) / length(data))
-ggplot(data, aes(x = x, y = y)) +
+# We want to compare actual session times to...
+hour24 <- sort(data$duration)
+
+# ... simulated session times if HSDir flags would have been assigned
+# after 25 or 26 hours, not 24.
+hour25 <- data[data$duration >= 3600, "duration"]
+hour25 <- sort(hour25) - 3600
+hour26 <- data[data$duration >= 7200, "duration"]
+hour26 <- sort(hour26) - 7200
+
+data <- rbind(
+  data.frame(x = hour24 / (60 * 60),
+  y = (length(hour24):1) / length(hour24),
+  type = "24 hours (implemented)"),
+  data.frame(x = hour25 / (60 * 60),
+  y = (length(hour25):1) / length(hour25),
+  type = "25 hours (simulated)"),
+  data.frame(x = hour26 / (60 * 60),
+  y = (length(hour26):1) / length(hour26),
+  type = "26 hours (simulated)"))
+
+ggplot(data[data$type == "24 hours (implemented)", ], aes(x = x, y = y)) +
 geom_line() +
 scale_y_continuous("Cumulative fraction of continuous HSDir sessions\n",
   formatter = "percent", limits = c(0, 1)) +
@@ -19,3 +37,15 @@ scale_x_continuous(paste("\nHSDir session time between the relay earning",
   limits = c(0, 3 * 24), breaks = seq(0, 3 * 24, 24))
 ggsave(filename = "hsdir-sessions.png", width = 8, height = 5, dpi = 72)
 
+ggplot(data, aes(x = x, y = y, colour = type)) +
+geom_line() +
+scale_y_continuous("Cumulative fraction of continuous HSDir sessions\n",
+  formatter = "percent", limits = c(0, 1)) +
+scale_x_continuous(paste("\nHSDir session time between the relay earning",
+  "the HSDir flag and going away in hours"),
+  limits = c(0, 3 * 24), breaks = seq(0, 3 * 24, 24)) +
+scale_colour_hue("HSDir flag assignment after") +
+opts(legend.position = "top")
+ggsave(filename = "hsdir-sessions-sim.png", width = 8, height = 5,
+  dpi = 72)
+



More information about the tor-commits mailing list