[or-cvs] [ernie/master] Split the network size and exit relays graphs page.
karsten at torproject.org
karsten at torproject.org
Tue Jun 8 10:07:45 UTC 2010
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Tue, 8 Jun 2010 12:06:45 +0200
Subject: Split the network size and exit relays graphs page.
Commit: 8b47356fd5f4a66c1f66f2c7441565f43696874d
---
etc/web.xml | 8 ++
.../ernie/web/BridgeUsersGraphsServlet.java | 1 +
.../ernie/web/ConsensusGraphsServlet.java | 92 ++++------------
.../ernie/web/ExitRelaysGraphsServlet.java | 111 ++++++++++++++++++++
.../ernie/web/NewUsersGraphsServlet.java | 1 +
.../ernie/web/RecurringUsersGraphsServlet.java | 1 +
website/gettor-graphs.html | 1 +
website/graphs.html | 1 +
website/torperf-graphs.html | 1 +
9 files changed, 147 insertions(+), 70 deletions(-)
create mode 100644 src/org/torproject/ernie/web/ExitRelaysGraphsServlet.java
diff --git a/etc/web.xml b/etc/web.xml
index 8798eac..478be08 100644
--- a/etc/web.xml
+++ b/etc/web.xml
@@ -91,6 +91,14 @@
<url-pattern>/bridge-users-graphs.html</url-pattern>
</servlet-mapping>
<servlet>
+ <servlet-name>ExitRelaysGraphsServlet</servlet-name>
+ <servlet-class>org.torproject.ernie.web.ExitRelaysGraphsServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ExitRelaysGraphsServlet</servlet-name>
+ <url-pattern>/exit-relays-graphs.html</url-pattern>
+ </servlet-mapping>
+ <servlet>
<servlet-name>ConsensusGraphsServlet</servlet-name>
<servlet-class>org.torproject.ernie.web.ConsensusGraphsServlet</servlet-class>
</servlet>
diff --git a/src/org/torproject/ernie/web/BridgeUsersGraphsServlet.java b/src/org/torproject/ernie/web/BridgeUsersGraphsServlet.java
index 8eaf50b..ee1788e 100644
--- a/src/org/torproject/ernie/web/BridgeUsersGraphsServlet.java
+++ b/src/org/torproject/ernie/web/BridgeUsersGraphsServlet.java
@@ -33,6 +33,7 @@ public class BridgeUsersGraphsServlet extends HttpServlet {
+ " <br/>\n"
+ " <font size=\"2\">\n"
+ " <a href=\"consensus-graphs.html\">Network size</a>\n"
+ + " <a href=\"exit-relays-graphs.html\">Exit relays</a>\n"
+ " <a href=\"new-users-graphs.html\">New users</a>\n"
+ " <a href=\"recurring-users-graphs.html\">Recurring users</a>\n"
+ " <a class=\"current\">Bridge users</a>\n"
diff --git a/src/org/torproject/ernie/web/ConsensusGraphsServlet.java b/src/org/torproject/ernie/web/ConsensusGraphsServlet.java
index 9b7948a..7b819b5 100644
--- a/src/org/torproject/ernie/web/ConsensusGraphsServlet.java
+++ b/src/org/torproject/ernie/web/ConsensusGraphsServlet.java
@@ -15,7 +15,7 @@ public class ConsensusGraphsServlet extends HttpServlet {
out.print("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+ "<html>\n"
+ " <head>\n"
- + " <title>Tor Metrics Portal: Relays in the Tor network</title>\n"
+ + " <title>Tor Metrics Portal: Relays and bridges in the Tor network</title>\n"
+ " <meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">\n"
+ " <link href=\"http://www.torproject.org/stylesheet-ltr.css\" type=text/css rel=stylesheet>\n"
+ " <link href=\"http://www.torproject.org/favicon.ico\" type=image/x-icon rel=\"shortcut icon\">\n"
@@ -33,6 +33,7 @@ public class ConsensusGraphsServlet extends HttpServlet {
+ " <br/>\n"
+ " <font size=\"2\">\n"
+ " <a class=\"current\">Network size</a>\n"
+ + " <a href=\"exit-relays-graphs.html\">Exit relays</a>\n"
+ " <a href=\"new-users-graphs.html\">New users</a>\n"
+ " <a href=\"recurring-users-graphs.html\">Recurring users</a>\n"
+ " <a href=\"bridge-users-graphs.html\">Bridge users</a>\n"
@@ -46,74 +47,40 @@ public class ConsensusGraphsServlet extends HttpServlet {
+ " <div class=\"main-column\">\n"
+ " <h2>Tor Metrics Portal: Graphs</h2>\n"
+ " <br/>\n"
- + " <h3>Relays in the Tor network</h3>\n"
+ + " <h3>Relays and bridges in the Tor network</h3>\n"
+ " <br/>\n"
- + " <p>The number of relays in the Tor network can be extracted from\n"
- + " the hourly published network status consensuses.</p>\n"
+ + " <p>The number of relays and bridges in the Tor network can be extracted from\n"
+ + " the hourly published network status consensuses and sanitized bridge statuses.</p>\n"
+ " <ul>\n"
- + " <li>Number of relays and bridges:\n"
- + " <ul>\n"
- + " <li>Past <a href=\"#networksize-30d\">30</a>,\n"
- + " <a href=\"#networksize-90d\">90</a>,\n"
- + " <a href=\"#networksize-180d\">180</a> days</li>\n"
- + " <li><a href=\"#networksize-all\">All data</a> up to today</li>\n"
- + " <li>Annual graphs of\n");
+ + " <li>Past <a href=\"#networksize-30d\">30</a>,\n"
+ + " <a href=\"#networksize-90d\">90</a>,\n"
+ + " <a href=\"#networksize-180d\">180</a> days</li>\n"
+ + " <li><a href=\"#networksize-all\">All data</a> up to today</li>\n"
+ + " <li>Annual graphs of\n");
Calendar now = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
Calendar lastQuarter = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
lastQuarter.add(Calendar.MONTH, -3);
Calendar lastMonth = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
lastMonth.add(Calendar.MONTH, -1);
for (int i = now.get(Calendar.YEAR); i > 2006; i--) {
- out.print(" <a href=\"#networksize-" + i + "\">"
+ out.print(" <a href=\"#networksize-" + i + "\">"
+ i + "</a>,\n");
}
- out.print(" <a href=\"#networksize-2006\">2006</a></li>\n");
- out.print(" <li>Quarterly graphs of\n");
- out.printf(" <a href=\"#networksize-%1$tY-q%2$d\">"
+ out.print(" <a href=\"#networksize-2006\">2006</a></li>\n");
+ out.print(" <li>Quarterly graphs of\n");
+ out.printf(" <a href=\"#networksize-%1$tY-q%2$d\">"
+ "Q%2$d %1$tY</a>,%n", now, 1 + now.get(Calendar.MONTH) / 3);
- out.printf(" <a href=\"#networksize-%1$tY-q%2$d\">"
+ out.printf(" <a href=\"#networksize-%1$tY-q%2$d\">"
+ "Q%2$d %1$tY</a></li>%n", lastQuarter, 1 + lastQuarter.get(Calendar.MONTH) / 3);
- out.print(" <li>Monthly graphs of\n");
- out.printf(" <a href=\"#networksize-%1$tY-%1$tm\">"
+ out.print(" <li>Monthly graphs of\n");
+ out.printf(" <a href=\"#networksize-%1$tY-%1$tm\">"
+ "%1$tb %1$tY</a>,%n", now);
- out.printf(" <a href=\"#networksize-%1$tY-%1$tm\">"
+ out.printf(" <a href=\"#networksize-%1$tY-%1$tm\">"
+ "%1$tb %1$tY</a></li>%n", lastMonth);
- out.print(" <li><a href=\"graphs/networksize/\">More graphs</a> of past\n"
- + " quarters and months</li>\n"
- + " <li><a href=\"csv/networksize.csv\">CSV</a> file\n"
- + " containing raw data</li>\n"
- + " </ul>\n"
- + " </li>\n"
- + " <li>Number of exit relays:\n"
- + " <ul>\n"
- + " <li>Past <a href=\"#exit-72h\">72 hours</a> up to\n"
- + " now</li>\n"
- + " <li>Past <a href=\"#exit-30d\">30</a>,\n"
- + " <a href=\"#exit-90d\">90</a>,\n"
- + " <a href=\"#exit-180d\">180</a> days</li>\n"
- + " <li><a href=\"#exit-all\">All data</a> up to today</li>\n"
- + " <li>Annual graphs of\n");
- for (int i = now.get(Calendar.YEAR); i > 2006; i--) {
- out.print(" <a href=\"#exit-" + i + "\">"
- + i + "</a>,\n");
- }
- out.print(" <a href=\"#exit-2006\">2006</a></li>\n");
- out.print(" <li>Quarterly graphs of\n");
- out.printf(" <a href=\"#exit-%1$tY-q%2$d\">"
- + "Q%2$d %1$tY</a>,%n", now, 1 + now.get(Calendar.MONTH) / 3);
- out.printf(" <a href=\"#exit-%1$tY-q%2$d\">"
- + "Q%2$d %1$tY</a></li>%n", lastQuarter, 1 + lastQuarter.get(Calendar.MONTH) / 3);
- out.print(" <li>Monthly graphs of\n");
- out.printf(" <a href=\"#exit-%1$tY-%1$tm\">"
- + "%1$tb %1$tY</a>,%n", now);
- out.printf(" <a href=\"#exit-%1$tY-%1$tm\">"
- + "%1$tb %1$tY</a></li>%n", lastMonth);
- out.print(" <li><a href=\"graphs/exit/\">More graphs</a> of past\n"
- + " quarters and months</li>\n"
- + " <li><a href=\"csv/exit.csv\">CSV</a> file\n"
- + " containing raw data</li>\n"
- + " </ul>\n"
- + " </li>\n"
+ out.print(" <li><a href=\"graphs/networksize/\">More graphs</a> of past\n"
+ + " quarters and months</li>\n"
+ + " <li><a href=\"csv/networksize.csv\">CSV</a> file\n"
+ + " containing raw data</li>\n"
+ " </ul>\n"
+ " <p><a id=\"networksize-30d\"/>\n"
+ " <img src=\"graphs/networksize/networksize-30d.png\"/>\n"
@@ -139,21 +106,6 @@ public class ConsensusGraphsServlet extends HttpServlet {
+ " <img src=\"graphs/networksize/networksize-%1$tY-%1$tm.png\"/>\n", now);
out.printf(" </p><p><a id=\"networksize-%1$tY-%1$tm\"/>\n"
+ " <img src=\"graphs/networksize/networksize-%1$tY-%1$tm.png\"/>\n", lastMonth);
- out.print(" </p><p><a id=\"exit-72h\"/><img src=\"graphs/exit/exit-72h.png\"/>\n"
- + " </p><p><a id=\"exit-30d\"/><img src=\"graphs/exit/exit-30d.png\"/>\n"
- + " </p><p><a id=\"exit-90d\"/><img src=\"graphs/exit/exit-90d.png\"/>\n"
- + " </p><p><a id=\"exit-180d\"/><img src=\"graphs/exit/exit-180d.png\"/>\n"
- + " </p><p><a id=\"exit-all\"/><img src=\"graphs/exit/exit-all.png\"/>\n");
- for (int i = now.get(Calendar.YEAR); i > 2006; i--) {
- out.print(" </p><p><a id=\"exit-" + i + "\"/><img src=\"graphs/exit/exit-" + i + ".png\"/>\n");
- }
- out.print(" </p><p><a id=\"exit-2006\"/><img src=\"graphs/exit/exit-2006.png\"/>\n");
- out.printf(" </p><p><a id=\"exit-%1$tY-q%2$d\"/><img src=\"graphs/exit/exit-%1$tY-q%2$d.png\"/>\n",
- now, 1 + now.get(Calendar.MONTH) / 3);
- out.printf(" </p><p><a id=\"exit-%1$tY-q%2$d\"/><img src=\"graphs/exit/exit-%1$tY-q%2$d.png\"/>\n",
- lastQuarter, 1 + lastQuarter.get(Calendar.MONTH) / 3);
- out.printf(" </p><p><a id=\"exit-%1$tY-%1$tm\"/><img src=\"graphs/exit/exit-%1$tY-%1$tm.png\"/>\n", now);
- out.printf(" </p><p><a id=\"exit-%1$tY-%1$tm\"/><img src=\"graphs/exit/exit-%1$tY-%1$tm.png\"/>\n", lastMonth);
out.print(" </p><br/>\n"
+ " </div>\n"
+ " </div>\n"
diff --git a/src/org/torproject/ernie/web/ExitRelaysGraphsServlet.java b/src/org/torproject/ernie/web/ExitRelaysGraphsServlet.java
new file mode 100644
index 0000000..929c9ee
--- /dev/null
+++ b/src/org/torproject/ernie/web/ExitRelaysGraphsServlet.java
@@ -0,0 +1,111 @@
+package org.torproject.ernie.web;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+import java.io.*;
+import java.util.*;
+
+public class ExitRelaysGraphsServlet extends HttpServlet {
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException {
+
+ PrintWriter out = response.getWriter();
+ out.print("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+ + "<html>\n"
+ + " <head>\n"
+ + " <title>Tor Metrics Portal: Exit relays in the Tor network</title>\n"
+ + " <meta http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">\n"
+ + " <link href=\"http://www.torproject.org/stylesheet-ltr.css\" type=text/css rel=stylesheet>\n"
+ + " <link href=\"http://www.torproject.org/favicon.ico\" type=image/x-icon rel=\"shortcut icon\">\n"
+ + " </head>\n"
+ + " <body>\n"
+ + " <div class=\"center\">\n"
+ + " <table class=\"banner\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\">\n"
+ + " <tr>\n"
+ + " <td class=\"banner-left\"><a href=\"https://www.torproject.org/\"><img src=\"http://www.torproject.org/images/top-left.png\" alt=\"Click to go to home page\" width=\"193\" height=\"79\"></a></td>\n"
+ + " <td class=\"banner-middle\">\n"
+ + " <a href=\"/\">Home</a>\n"
+ + " <a href=\"graphs.html\">Graphs</a>\n"
+ + " <a href=\"research.html\">Research</a>\n"
+ + " <a href=\"status.html\">Status</a>\n"
+ + " <br/>\n"
+ + " <font size=\"2\">\n"
+ + " <a href=\"consensus-graphs.html\">Network size</a>\n"
+ + " <a class=\"current\">Exit relays</a>\n"
+ + " <a href=\"new-users-graphs.html\">New users</a>\n"
+ + " <a href=\"recurring-users-graphs.html\">Recurring users</a>\n"
+ + " <a href=\"bridge-users-graphs.html\">Bridge users</a>\n"
+ + " <a href=\"torperf-graphs.html\">torperf</a>\n"
+ + " <a href=\"gettor-graphs.html\">GetTor</a>\n"
+ + " </font>\n"
+ + " </td>\n"
+ + " <td class=\"banner-right\"></td>\n"
+ + " </tr>\n"
+ + " </table>\n"
+ + " <div class=\"main-column\">\n"
+ + " <h2>Tor Metrics Portal: Graphs</h2>\n"
+ + " <br/>\n"
+ + " <h3>Exit relays in the Tor network</h3>\n"
+ + " <br/>\n"
+ + " <p>The number of exit relays in the Tor network can be extracted from\n"
+ + " the hourly published network status consensuses.</p>\n"
+ + " <ul>\n"
+ + " <li>Past <a href=\"#exit-72h\">72 hours</a> up to\n"
+ + " now</li>\n"
+ + " <li>Past <a href=\"#exit-30d\">30</a>,\n"
+ + " <a href=\"#exit-90d\">90</a>,\n"
+ + " <a href=\"#exit-180d\">180</a> days</li>\n"
+ + " <li><a href=\"#exit-all\">All data</a> up to today</li>\n"
+ + " <li>Annual graphs of\n");
+ Calendar now = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ Calendar lastQuarter = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ lastQuarter.add(Calendar.MONTH, -3);
+ Calendar lastMonth = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
+ lastMonth.add(Calendar.MONTH, -1);
+ for (int i = now.get(Calendar.YEAR); i > 2006; i--) {
+ out.print(" <a href=\"#exit-" + i + "\">"
+ + i + "</a>,\n");
+ }
+ out.print(" <a href=\"#exit-2006\">2006</a></li>\n");
+ out.print(" <li>Quarterly graphs of\n");
+ out.printf(" <a href=\"#exit-%1$tY-q%2$d\">"
+ + "Q%2$d %1$tY</a>,%n", now, 1 + now.get(Calendar.MONTH) / 3);
+ out.printf(" <a href=\"#exit-%1$tY-q%2$d\">"
+ + "Q%2$d %1$tY</a></li>%n", lastQuarter, 1 + lastQuarter.get(Calendar.MONTH) / 3);
+ out.print(" <li>Monthly graphs of\n");
+ out.printf(" <a href=\"#exit-%1$tY-%1$tm\">"
+ + "%1$tb %1$tY</a>,%n", now);
+ out.printf(" <a href=\"#exit-%1$tY-%1$tm\">"
+ + "%1$tb %1$tY</a></li>%n", lastMonth);
+ out.print(" <li><a href=\"csv/exit.csv\">CSV</a> file\n"
+ + " containing raw data</li>\n"
+ + " </ul>\n");
+ out.print(" </p><p><a id=\"exit-72h\"/><img src=\"graphs/exit/exit-72h.png\"/>\n"
+ + " </p><p><a id=\"exit-30d\"/><img src=\"graphs/exit/exit-30d.png\"/>\n"
+ + " </p><p><a id=\"exit-90d\"/><img src=\"graphs/exit/exit-90d.png\"/>\n"
+ + " </p><p><a id=\"exit-180d\"/><img src=\"graphs/exit/exit-180d.png\"/>\n"
+ + " </p><p><a id=\"exit-all\"/><img src=\"graphs/exit/exit-all.png\"/>\n");
+ for (int i = now.get(Calendar.YEAR); i > 2006; i--) {
+ out.print(" </p><p><a id=\"exit-" + i + "\"/><img src=\"graphs/exit/exit-" + i + ".png\"/>\n");
+ }
+ out.print(" </p><p><a id=\"exit-2006\"/><img src=\"graphs/exit/exit-2006.png\"/>\n");
+ out.printf(" </p><p><a id=\"exit-%1$tY-q%2$d\"/><img src=\"graphs/exit/exit-%1$tY-q%2$d.png\"/>\n",
+ now, 1 + now.get(Calendar.MONTH) / 3);
+ out.printf(" </p><p><a id=\"exit-%1$tY-q%2$d\"/><img src=\"graphs/exit/exit-%1$tY-q%2$d.png\"/>\n",
+ lastQuarter, 1 + lastQuarter.get(Calendar.MONTH) / 3);
+ out.printf(" </p><p><a id=\"exit-%1$tY-%1$tm\"/><img src=\"graphs/exit/exit-%1$tY-%1$tm.png\"/>\n", now);
+ out.printf(" </p><p><a id=\"exit-%1$tY-%1$tm\"/><img src=\"graphs/exit/exit-%1$tY-%1$tm.png\"/>\n", lastMonth);
+ out.print(" </p><br/>\n"
+ + " </div>\n"
+ + " </div>\n"
+ + " <div class=\"bottom\" id=\"bottom\">\n"
+ + " <p>\"Tor\" and the \"Onion Logo\" are <a href=\"https://www.torproject.org/trademark-faq.html.en\">registered trademarks</a> of The Tor Project, Inc.</p>\n"
+ + " </div>\n"
+ + " </body>\n"
+ + "</html>\n");
+ out.close();
+ }
+}
+
diff --git a/src/org/torproject/ernie/web/NewUsersGraphsServlet.java b/src/org/torproject/ernie/web/NewUsersGraphsServlet.java
index c284d8a..276ba32 100644
--- a/src/org/torproject/ernie/web/NewUsersGraphsServlet.java
+++ b/src/org/torproject/ernie/web/NewUsersGraphsServlet.java
@@ -33,6 +33,7 @@ public class NewUsersGraphsServlet extends HttpServlet {
+ " <br/>\n"
+ " <font size=\"2\">\n"
+ " <a href=\"consensus-graphs.html\">Network size</a>\n"
+ + " <a href=\"exit-relays-graphs.html\">Exit relays</a>\n"
+ " <a class=\"current\">New users</a>\n"
+ " <a href=\"recurring-users-graphs.html\">Recurring users</a>\n"
+ " <a href=\"bridge-users-graphs.html\">Bridge users</a>\n"
diff --git a/src/org/torproject/ernie/web/RecurringUsersGraphsServlet.java b/src/org/torproject/ernie/web/RecurringUsersGraphsServlet.java
index e609f0d..0294025 100644
--- a/src/org/torproject/ernie/web/RecurringUsersGraphsServlet.java
+++ b/src/org/torproject/ernie/web/RecurringUsersGraphsServlet.java
@@ -33,6 +33,7 @@ public class RecurringUsersGraphsServlet extends HttpServlet {
+ " <br/>\n"
+ " <font size=\"2\">\n"
+ " <a href=\"consensus-graphs.html\">Network size</a>\n"
+ + " <a href=\"exit-relays-graphs.html\">Exit relays</a>\n"
+ " <a href=\"new-users-graphs.html\">New users</a>\n"
+ " <a class=\"current\">Recurring users</a>\n"
+ " <a href=\"bridge-users-graphs.html\">Bridge users</a>\n"
diff --git a/website/gettor-graphs.html b/website/gettor-graphs.html
index 9882ec1..0a567d7 100644
--- a/website/gettor-graphs.html
+++ b/website/gettor-graphs.html
@@ -19,6 +19,7 @@
<br/>
<font size="2">
<a href="consensus-graphs.html">Network size</a>
+ <a href="exit-relays-graphs.html">Exit relays</a>
<a href="new-users-graphs.html">New users</a>
<a href="recurring-users-graphs.html">Recurring users</a>
<a href="bridge-users-graphs.html">Bridge users</a>
diff --git a/website/graphs.html b/website/graphs.html
index 2a479e1..e3762c9 100644
--- a/website/graphs.html
+++ b/website/graphs.html
@@ -19,6 +19,7 @@
<br/>
<font size="2">
<a href="consensus-graphs.html">Network size</a>
+ <a href="exit-relays-graphs.html">Exit relays</a>
<a href="new-users-graphs.html">New users</a>
<a href="recurring-users-graphs.html">Recurring users</a>
<a href="bridge-users-graphs.html">Bridge users</a>
diff --git a/website/torperf-graphs.html b/website/torperf-graphs.html
index 8ff3827..017a134 100644
--- a/website/torperf-graphs.html
+++ b/website/torperf-graphs.html
@@ -19,6 +19,7 @@
<br/>
<font size="2">
<a href="consensus-graphs.html">Network size</a>
+ <a href="exit-relays-graphs.html">Exit relays</a>
<a href="new-users-graphs.html">New users</a>
<a href="recurring-users-graphs.html">Recurring users</a>
<a href="bridge-users-graphs.html">Bridge users</a>
--
1.6.5
More information about the tor-commits
mailing list