[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Option to plot sum of all non-<OR> transports



commit 0ea16444cfefa9ca5f0a0ad032494d1c4aaae545
Author: Joe Landers <joe@xxxxxxxxxxxxxx>
Date:   Thu Jun 26 20:25:35 2014 +0200

    Option to plot sum of all non-<OR> transports
    
    Finishes #11799
---
 website/rserve/graphs.R                               |   17 ++++++++++++-----
 .../metrics/web/graphs/GraphParameterChecker.java     |    2 +-
 website/web/WEB-INF/users.jsp                         |    1 +
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/website/rserve/graphs.R b/website/rserve/graphs.R
index 5a130ee..b1adc85 100644
--- a/website/rserve/graphs.R
+++ b/website/rserve/graphs.R
@@ -796,9 +796,15 @@ plot_userstats <- function(start, end, node, variable, value, events,
       title <- "Directly connecting users\n"
     }
   } else if (variable == 'transport') {
-    u <- u[u$transport == value & u$node == 'bridge', ]
-    title <- paste("Bridge users using transport ", value, "\n",
-                   sep = "")
+    if (value != '!<*>') {
+        u <- u[u$transport == value & u$node == 'bridge', ]
+        title <- paste("Bridge users using transport ", value, "\n",
+                    sep = "")
+    } else {
+        u <- u[u$transport != '' & u$transport != '<OR>' &
+               u$node == 'bridge', ]
+        title <- paste("Bridge users using any pluggable transport")
+    }
   } else if (variable == 'version') {
     u <- u[u$version== value & u$node == 'bridge', ]
     title <- paste("Bridge users using IP", value, "\n", sep = "")
@@ -813,8 +819,9 @@ plot_userstats <- function(start, end, node, variable, value, events,
       title <- "Bridge users\n"
     }
   }
-  u <- data.frame(date = as.Date(u$date, "%Y-%m-%d"), users = u$clients,
-                  lower = u$lower, upper = u$upper)
+  u <- aggregate(list(lower = u$lower, upper = u$upper,
+                      users = u$clients),
+                 by = list(date = as.Date(u$date, "%Y-%m-%d")), FUN = sum)
   dates <- seq(from = as.Date(start, "%Y-%m-%d"),
       to = as.Date(end, "%Y-%m-%d"), by="1 day")
   missing <- setdiff(dates, u$date)
diff --git a/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java b/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
index 7b0ea9e..ab77943 100644
--- a/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
+++ b/website/src/org/torproject/metrics/web/graphs/GraphParameterChecker.java
@@ -59,7 +59,7 @@ public class GraphParameterChecker {
     this.knownParameterValues.put("source", "all,siv,moria,torperf");
     this.knownParameterValues.put("filesize", "50kb,1mb,5mb");
     this.knownParameterValues.put("transport",
-        "obfs2,obfs3,websocket,fte,meek,scramblesuit,<OR>,<??>");
+        "obfs2,obfs3,websocket,fte,meek,scramblesuit,<OR>,<??>,!<*>");
     this.knownParameterValues.put("version", "v4,v6");
     this.knownParameterValues.put("p", "100,99,98,97,95,91,90,80,75,70,"
         + "60,50,40,30,25,20,10,9,5,3,2,1,0");
diff --git a/website/web/WEB-INF/users.jsp b/website/web/WEB-INF/users.jsp
index 0a31569..00e3730 100644
--- a/website/web/WEB-INF/users.jsp
+++ b/website/web/WEB-INF/users.jsp
@@ -221,6 +221,7 @@ Bridge users by transport:
         <option value="meek"<c:if test="${userstats_bridge_transport_transport[0] eq 'meek'}"> selected</c:if>>meek</option>
         <option value="scramblesuit"<c:if test="${userstats_bridge_transport_transport[0] eq 'scramblesuit'}"> selected</c:if>>scramblesuit</option>
         <option value="<??>"<c:if test="${userstats_bridge_transport_transport[0] eq '<??>'}"> selected</c:if>>Unknown transport</option>
+        <option value="!<*>"<c:if test="${userstats_bridge_transport_transport[0] eq '!<*>'}"> selected</c:if>>Any non-<OR> transport</option>
       </select>
     </p><p>
     <input class="submit" type="submit" value="Update graph">



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits