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

[tor-commits] [metrics-web/master] Fix by-country CSV files.



commit 28f567c1ae0458362ac24d491484b81e7bc37afd
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Sat Dec 29 10:07:45 2018 +0100

    Fix by-country CSV files.
    
    Fixes #28945.
---
 src/main/R/rserver/graphs.R | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R
index 1ca9357..03b5b93 100644
--- a/src/main/R/rserver/graphs.R
+++ b/src/main/R/rserver/graphs.R
@@ -922,14 +922,15 @@ write_userstats_relay_country <- function(start_p = NULL, end_p = NULL,
         lower = col_double(),
         upper = col_double(),
         clients = col_double(),
-        frac = col_double())) %>%
+        frac = col_double()),
+      na = character()) %>%
     filter(node == "relay") %>%
     filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
     filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
     filter(if (!is.null(country_p))
       country == ifelse(country_p == "all", "", country_p) else TRUE) %>%
-    filter(is.na(transport)) %>%
-    filter(is.na(version)) %>%
+    filter(transport == "") %>%
+    filter(version == "") %>%
     select(date, country, clients, lower, upper, frac) %>%
     rename(users = clients) %>%
     write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
@@ -947,14 +948,15 @@ write_userstats_bridge_country <- function(start_p = NULL, end_p = NULL,
         lower = col_double(),
         upper = col_double(),
         clients = col_double(),
-        frac = col_double())) %>%
+        frac = col_double()),
+      na = character()) %>%
     filter(node == "bridge") %>%
     filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
     filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
     filter(if (!is.null(country_p))
       country == ifelse(country_p == "all", "", country_p) else TRUE) %>%
-    filter(is.na(transport)) %>%
-    filter(is.na(version)) %>%
+    filter(transport == "") %>%
+    filter(version == "") %>%
     select(date, country, clients, frac) %>%
     rename(users = clients) %>%
     write.csv(path_p, quote = FALSE, row.names = FALSE, na = "")
@@ -1031,7 +1033,8 @@ prepare_userstats_bridge_combined <- function(start_p, end_p, country_p) {
         version = col_skip(),
         frac = col_double(),
         low = col_double(),
-        high = col_double())) %>%
+        high = col_double()),
+      na = character()) %>%
     filter(if (!is.null(start_p)) date >= as.Date(start_p) else TRUE) %>%
     filter(if (!is.null(end_p)) date <= as.Date(end_p) else TRUE) %>%
     filter(if (!is.null(country_p)) country == country_p else TRUE)

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