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

[tor-commits] [metrics-web/master] Only consider stricly lower counts as downturns. task-21419



commit b2f7bae8f6b128e3da2973ff53fc010bfdde2ca7
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date:   Tue Jan 17 08:16:20 2017 +0000

    Only consider stricly lower counts as downturns.  task-21419
---
 website/rserve/graphs.R | 2 +-
 website/rserve/tables.R | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/website/rserve/graphs.R b/website/rserve/graphs.R
index fad2e1b..19264cc 100644
--- a/website/rserve/graphs.R
+++ b/website/rserve/graphs.R
@@ -864,7 +864,7 @@ plot_userstats <- function(start, end, node, variable, value, events,
   if (length(na.omit(u$users)) > 0 & events != "off" &
       variable == 'country' & length(value) == 1 && value != "all") {
     upturns <- u[u$users > u$upper, c("date", "users")]
-    downturns <- u[u$users <= u$lower, c("date", "users")]
+    downturns <- u[u$users < u$lower, c("date", "users")]
     if (events == "on") {
       u[!is.na(u$lower) & u$lower < 0, "lower"] <- 0
       plot <- plot +
diff --git a/website/rserve/tables.R b/website/rserve/tables.R
index bb2cbc8..28bd3d5 100644
--- a/website/rserve/tables.R
+++ b/website/rserve/tables.R
@@ -43,7 +43,7 @@ write_userstats_censorship_events <- function(start, end, path) {
                   upturn = ifelse(!is.na(c$upper) &
                                   c$clients > c$upper, 1, 0),
                   downturn = ifelse(!is.na(c$lower) &
-                                    c$clients <= c$lower, 1, 0))
+                                    c$clients < c$lower, 1, 0))
   r <- aggregate(r[, c("upturn", "downturn")],
     by = list(country = r$country), sum)
   r <- r[(r$country %in% names(countrylist)), ]

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