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

[tor-commits] [metrics-web/master] Fix TB downloads by locale and Relays by flag graphs.



commit 4cb0fd677271a1faa3a7f99e5e7868d5cf50a7a8
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed May 9 15:13:55 2018 +0200

    Fix TB downloads by locale and Relays by flag graphs.
---
 src/main/R/rserver/graphs.R | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R
index b6eb221..79d5600 100644
--- a/src/main/R/rserver/graphs.R
+++ b/src/main/R/rserver/graphs.R
@@ -580,8 +580,8 @@ plot_relayflags <- function(start, end, flags, path) {
 
 write_relayflags <- function(start, end, flags, path) {
   prepare_relayflags(start, end, flags) %>%
-    mutate(variable = tolower(variable)) %>%
-    spread(variable, value) %>%
+    mutate(flag = tolower(flag)) %>%
+    spread(flag, relays) %>%
     write.csv(path, quote = FALSE, row.names = FALSE)
 }
 
@@ -1269,7 +1269,7 @@ write_webstats_tb_platform <- function(start, end, path) {
 
 plot_webstats_tb_locale <- function(start, end, path) {
   d <- read.csv(paste(stats_dir, "webstats.csv", sep = ""),
-    colClasses = c("log_date" = "Date"))
+    colClasses = c("log_date" = "Date", "locale" = "character"))
   d <- d[d$log_date >= start & d$log_date <= end & d$request_type == "tbid", ]
   e <- d
   e <- aggregate(list(count = e$count), by = list(locale = e$locale), FUN = sum)
@@ -1300,7 +1300,7 @@ plot_webstats_tb_locale <- function(start, end, path) {
 # breaks and labels. Left as future work.
 write_webstats_tb_locale <- function(start, end, path) {
   d <- read.csv(paste(stats_dir, "webstats.csv", sep = ""),
-    colClasses = c("log_date" = "Date"))
+    colClasses = c("log_date" = "Date", "locale" = "character"))
   d <- d[d$log_date >= start & d$log_date <= end & d$request_type == "tbid", ]
   e <- d
   e <- aggregate(list(count = e$count), by = list(locale = e$locale), FUN = sum)

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