Put #6498 graphs on a new page on the metrics website.

Requires running metrics-tasks.git/task-6498 locally.
This commit is contained in:
Karsten Loesing 2012-08-03 15:28:04 +02:00
parent 1bf662cbf5
commit f0c1411185
5 changed files with 80 additions and 0 deletions

View File

@ -38,6 +38,10 @@
<servlet-name>GraphsSubpages</servlet-name>
<url-pattern>/network.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GraphsSubpages</servlet-name>
<url-pattern>/fast-exits.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GraphsSubpages</servlet-name>
<url-pattern>/users.html</url-pattern>
@ -217,6 +221,14 @@
<servlet-name>GraphImage</servlet-name>
<url-pattern>/connbidirect.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GraphImage</servlet-name>
<url-pattern>/fast-exits.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GraphImage</servlet-name>
<url-pattern>/almost-fast-exits.png</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Csv</servlet-name>

View File

@ -957,3 +957,62 @@ plot_connbidirect <- function(start, end, path, dpi) {
ggsave(filename = path, width = 8, height = 5, dpi = as.numeric(dpi))
}
plot_fast_exits <- function(start, end, path, dpi) {
r <- read.csv(paste("/srv/metrics.torproject.org/task-6498-graphs/",
"task-6498/task-6498-results.csv", sep = ""),
stringsAsFactors = FALSE)
r <- r[r$valid_after >= paste(start, "00:00:00") &
r$valid_after <= paste(end, "23:59:59") &
r$valid_after < paste(Sys.Date() - 1, "23:59:59"), ]
r <- r[r$min_rate == 11875 & r$ports == "80-443-554-1755" &
r$min_advbw == 5000, ]
r <- aggregate(list(relays = r$relays, P_exit = 100 * r$exit_prob),
by = list(date = as.Date(cut.Date(as.Date(r$valid_after), "day"))),
FUN = median)
r <- melt(r, id.vars = c("date"))
r <- data.frame(r, type = ifelse(r$variable == "P_exit",
"Total exit probability (in %)", "Number of relays"))
ggplot(r, aes(x = date, y = value)) +
geom_line(colour = "purple", size = 0.75) +
facet_grid(type ~ ., scales = "free_y") +
scale_x_date(name = "") +
scale_y_continuous(name = "") +
scale_colour_manual(values = c("purple", "orange")) +
opts(title = paste("Fast exits (95+ Mbit/s configured bandwidth",
"rate,\n5000+ KB/s advertised bandwidth capacity,\n",
"exit to ports 80, 443, 554, and 1755,\n",
"at most 2 relays per /24 network)\n", sep = ""))
ggsave(filename = path, width = 8, height = 6, dpi = as.numeric(dpi))
}
plot_almost_fast_exits <- function(start, end, path, dpi) {
t <- read.csv(paste("/srv/metrics.torproject.org/task-6498-graphs/",
"task-6498/task-6498-results.csv", sep = ""),
stringsAsFactors = FALSE)
t <- t[t$valid_after >= paste(start, "00:00:00") &
t$valid_after <= paste(end, "23:59:59") &
t$valid_after < paste(Sys.Date() - 1, "23:59:59"), ]
t1 <- t[t$min_rate == 11875 & t$ports == "80-443-554-1755" &
t$min_advbw == 5000, ]
t2 <- t[t$min_rate == 10000 & t$ports == "80-443" &
t$min_advbw == 2000, ]
t <- rbind(
data.frame(t1, var = "95+ Mbit/s, 5000+ KB/s, 80/443/554/1755"),
data.frame(t2, var = "80+ Mbit/s, 2000+ KB/s, 80/443"))
t <- aggregate(list(relays = t$relays, P_exit = 100 * t$exit_prob),
by = list(date = as.Date(cut.Date(as.Date(t$valid_after), "day")),
var = t$var), FUN = median)
t <- melt(t, id.vars = c("date", "var"))
t <- data.frame(t, type = ifelse(t$variable == "P_exit",
"Total exit probability (in %)", "Number of relays"))
ggplot(t, aes(x = date, y = value, colour = var)) +
geom_line(size = 0.75) +
facet_grid(type ~ ., scales = "free_y") +
scale_x_date(name = "") +
scale_y_continuous(name = "") +
scale_colour_manual(name = "", values = c("purple", "orange")) +
opts(title = "Relays almost meeting the fast-exit requirements",
legend.position = "top")
ggsave(filename = path, width = 8, height = 6, dpi = as.numeric(dpi))
}

View File

@ -39,6 +39,8 @@ public class GraphsSubpagesServlet extends HttpServlet {
this.availableGraphsSubpages = new HashMap<String, String>();
this.availableGraphsSubpages.put("network.html",
"WEB-INF/network.jsp");
this.availableGraphsSubpages.put("fast-exits.html",
"WEB-INF/fast-exits.jsp");
this.availableGraphsSubpages.put("users.html", "WEB-INF/users.jsp");
this.availableGraphsSubpages.put("packages.html",
"WEB-INF/packages.jsp");

View File

@ -101,6 +101,9 @@ public class RObjectGenerator implements ServletContextListener {
this.availableGraphs.put("torperf-failures",
"start,end,source,filesize,filename,dpi");
this.availableGraphs.put("connbidirect", "start,end,filename,dpi");
this.availableGraphs.put("fast-exits", "start,end,filename,dpi");
this.availableGraphs.put("almost-fast-exits",
"start,end,filename,dpi");
GraphParameterChecker.getInstance().setAvailableGraphs(
availableGraphs);

View File

@ -16,6 +16,7 @@
%>class="current"<%} else {%>href="/status.html"<%}%>>Status</a>
<%if (currentPage.endsWith("graphs.jsp") ||
currentPage.endsWith("network.jsp") ||
currentPage.endsWith("fast-exits.jsp") ||
currentPage.endsWith("users.jsp") ||
currentPage.endsWith("performance.jsp")) {
%><br>
@ -23,6 +24,9 @@
<a <%if (currentPage.endsWith("network.jsp")){
%>class="current"<%} else {%>href="/network.html"<%}
%>>Network</a>
<a <%if (currentPage.endsWith("fast-exits.jsp")){
%>class="current"<%} else {%>href="/fast-exits.html"<%}
%>>Fast Exits</a>
<a <%if (currentPage.endsWith("users.jsp")) {
%>class="current"<%} else {%>href="/users.html"<%}
%>>Users</a>