[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [metrics-web/master] Add new graph on Torperf timeouts and failures.
commit 4421b7abc926fc199afa7fbb4f548988a23d599b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu Jan 27 15:40:51 2011 +0100
Add new graph on Torperf timeouts and failures.
---
etc/web.xml | 4 ++
rserve/csv.R | 12 +++++
rserve/graphs.R | 48 ++++++++++++++++++++
src/org/torproject/ernie/web/CsvServlet.java | 1 +
.../ernie/web/GraphParameterChecker.java | 2 +
web/WEB-INF/index.jsp | 3 +
web/WEB-INF/performance.jsp | 40 ++++++++++++++++
7 files changed, 110 insertions(+), 0 deletions(-)
diff --git a/etc/web.xml b/etc/web.xml
index 257d227..145472b 100644
--- a/etc/web.xml
+++ b/etc/web.xml
@@ -213,6 +213,10 @@
</servlet-mapping>
<servlet-mapping>
<servlet-name>GraphImage</servlet-name>
+ <url-pattern>/torperf-failures.png</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>GraphImage</servlet-name>
<url-pattern>/connbidirect.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
diff --git a/rserve/csv.R b/rserve/csv.R
index 6b5bbcc..44138ac 100644
--- a/rserve/csv.R
+++ b/rserve/csv.R
@@ -202,6 +202,18 @@ export_torperf <- function(path) {
write.csv(torperf, path, quote = FALSE, row.names = FALSE)
}
+export_torperf_failures <- function(path) {
+ drv <- dbDriver("PostgreSQL")
+ con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
+ q <- paste("SELECT source, date, timeouts, failures, requests",
+ "FROM torperf_stats ORDER BY source, date")
+ rs <- dbSendQuery(con, q)
+ torperf <- fetch(rs, n = -1)
+ dbDisconnect(con)
+ dbUnloadDriver(drv)
+ write.csv(torperf, path, quote = FALSE, row.names = FALSE)
+}
+
help_export_monthly_users <- function(path, aggr_fun) {
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
diff --git a/rserve/graphs.R b/rserve/graphs.R
index 929e1be..8df2eac 100644
--- a/rserve/graphs.R
+++ b/rserve/graphs.R
@@ -381,6 +381,54 @@ plot_torperf <- function(start, end, source, filesize, path) {
ggsave(filename = path, width = 8, height = 5, dpi = 72)
}
+plot_torperf_failures <- function(start, end, source, filesize, path) {
+ drv <- dbDriver("PostgreSQL")
+ con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
+ q <- paste("SELECT date, timeouts, failures, requests ",
+ "FROM torperf_stats WHERE source = '",
+ paste(source, filesize, sep = "-"),
+ "' AND date >= '", start, "' AND date <= '", end, "'", sep = "")
+ rs <- dbSendQuery(con, q)
+ torperf <- fetch(rs, n = -1)
+ dbDisconnect(con)
+ dbUnloadDriver(drv)
+ dates <- seq(from = as.Date(start, "%Y-%m-%d"),
+ to = as.Date(end, "%Y-%m-%d"), by="1 day")
+ missing <- setdiff(dates, torperf$date)
+ if (length(missing) > 0)
+ torperf <- rbind(torperf,
+ data.frame(date = as.Date(missing, origin = "1970-01-01"),
+ timeouts = NA, failures = NA, requests = NA))
+ colours <- data.frame(source = c("all", "siv", "moria", "torperf"),
+ colour = c("#FF8C00", "#0000EE", "#EE0000", "#00CD00"),
+ stringsAsFactors = FALSE)
+ colour <- colours[colours$source == source, "colour"]
+ filesizes <- data.frame(filesizes = c("5mb", "1mb", "50kb"),
+ label = c("5 MiB", "1 MiB", "50 KiB"), stringsAsFactors = FALSE)
+ filesizeStr <- filesizes[filesizes$filesize == filesize, "label"]
+ torperf <- rbind(data.frame(date = torperf$date,
+ value = ifelse(torperf$requests > 0,
+ torperf$timeouts / torperf$requests, 0),
+ variable = "timeouts"),
+ data.frame(date = torperf$date,
+ value = ifelse(torperf$requests > 0,
+ torperf$failures / torperf$requests, 0),
+ variable = "failures"))
+ ggplot(torperf, aes(x = as.Date(date, "%Y-%m-%d"), y = value,
+ colour = variable)) +
+ geom_point(size = 2) +
+ scale_x_date(name = paste("\nThe Tor Project - ",
+ "https://metrics.torproject.org/", sep = "")) +
+ scale_y_continuous(name = "", formatter = "percent") +
+ scale_colour_hue(name = paste("Problems encountered on",
+ ifelse(source == "all", "all sources", source)),
+ h.start = 45, breaks = c("timeouts", "failures"),
+ labels = c("Timeouts", "Failures")) +
+ opts(title = paste("Timeouts and failures of", filesizeStr,
+ "requests"), legend.position = "top")
+ ggsave(filename = path, width = 8, height = 5, dpi = 72)
+}
+
plot_connbidirect <- function(start, end, path) {
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
diff --git a/src/org/torproject/ernie/web/CsvServlet.java b/src/org/torproject/ernie/web/CsvServlet.java
index 47cf721..33c098f 100644
--- a/src/org/torproject/ernie/web/CsvServlet.java
+++ b/src/org/torproject/ernie/web/CsvServlet.java
@@ -43,6 +43,7 @@ public class CsvServlet extends HttpServlet {
this.availableCsvFiles.add("relayflags");
this.availableCsvFiles.add("relayflags-hour");
this.availableCsvFiles.add("torperf");
+ this.availableCsvFiles.add("torperf-failures");
this.availableCsvFiles.add("versions");
/* Get a reference to the R object generator that we need to generate
diff --git a/src/org/torproject/ernie/web/GraphParameterChecker.java b/src/org/torproject/ernie/web/GraphParameterChecker.java
index 188c6fa..3d255d7 100644
--- a/src/org/torproject/ernie/web/GraphParameterChecker.java
+++ b/src/org/torproject/ernie/web/GraphParameterChecker.java
@@ -54,6 +54,8 @@ public class GraphParameterChecker {
this.availableGraphs.put("gettor", "start,end,bundle,filename");
this.availableGraphs.put("torperf",
"start,end,source,filesize,filename");
+ this.availableGraphs.put("torperf-failures",
+ "start,end,source,filesize,filename");
this.availableGraphs.put("connbidirect", "start,end,filename");
this.availableGraphs.put("routerdetail", "fingerprint,filename");
diff --git a/web/WEB-INF/index.jsp b/web/WEB-INF/index.jsp
index b9c3d87..f82a7b3 100644
--- a/web/WEB-INF/index.jsp
+++ b/web/WEB-INF/index.jsp
@@ -32,6 +32,9 @@
<br>
<h3>News</h3>
<ul>
+ <li>January 27, 2011: New <a href="performance.html">Torperf</a>
+ graphs combining the download times of all sources and showing
+ the fraction of timeouts and failures are now available.</li>
<li>December 29, 2010: Tech report with an
<a href="papers/data-2010-12-29.pdf">Overview of Statistical
Data in the Tor Network</a> is available for download on the
diff --git a/web/WEB-INF/performance.jsp b/web/WEB-INF/performance.jsp
index 2aeb7db..921fd61 100644
--- a/web/WEB-INF/performance.jsp
+++ b/web/WEB-INF/performance.jsp
@@ -51,6 +51,46 @@ quartile of request times.</p>
<p><a href="csv/torperf.csv">CSV</a> file containing all data.</p>
<br>
+<h3>Timeouts and failures of downloading files over Tor</h3>
+<br>
+<p>The following graphs show the fraction of timeouts and failures of
+downloading files over Tor as experienced by users.
+A timeout occurs when a 50 KiB (1 MiB, 5 MiB) download does not complete
+within 4:55 minutes (29:55 minutes, 59:55 minutes).
+A failure occurs when the download completes, but the response is smaller
+than 50 KiB (1 MiB, 5 MiB).</p>
+<a name="torperf-failures"></a>
+<img src="torperf-failures.png${torperf_failures_url}"
+ width="576" height="360" alt="Torperf failures graph">
+<form action="performance.html#torperf-failures">
+ <div class="formrow">
+ <input type="hidden" name="graph" value="torperf-failures">
+ <p>
+ <label>Start date (yyyy-mm-dd):</label>
+ <input type="text" name="start" size="10"
+ value="${torperf_failures_start[0]}">
+ <label>End date (yyyy-mm-dd):</label>
+ <input type="text" name="end" size="10"
+ value="${torperf_failures_end[0]}">
+ </p><p>
+ Source:
+ <input type="radio" name="source" value="all"> all
+ <input type="radio" name="source" value="torperf"> torperf
+ <input type="radio" name="source" value="moria"> moria
+ <input type="radio" name="source" value="siv"> siv
+ </p><p>
+ <label>File size: </label>
+ <input type="radio" name="filesize" value="50kb"> 50 KiB
+ <input type="radio" name="filesize" value="1mb"> 1 MiB
+ <input type="radio" name="filesize" value="5mb"> 5 MiB
+ </p><p>
+ <input class="submit" type="submit" value="Update graph">
+ </p>
+ </div>
+</form>
+<p><a href="csv/torperf-failures.csv">CSV</a> file containing all data.</p>
+
+<br>
<h3>Fraction of connections used uni-/bidirectionally</h3>
<br>
<p>The following graph shows the fraction of connections that is used