commit e797903fb93b70c675d2b1655c9d333a713f6bfb Author: Karsten Loesing karsten.loesing@gmx.net Date: Fri Feb 9 17:57:26 2018 +0100
Remove unused code for plotting relays by country. --- src/main/R/rserver/graphs.R | 35 ----------------------------------- 1 file changed, 35 deletions(-)
diff --git a/src/main/R/rserver/graphs.R b/src/main/R/rserver/graphs.R index e24a617..2a055c2 100644 --- a/src/main/R/rserver/graphs.R +++ b/src/main/R/rserver/graphs.R @@ -311,41 +311,6 @@ plot_networksize <- function(start, end, path) { ggsave(filename = path, width = 8, height = 5, dpi = 150) }
-plot_relaycountries <- function(start, end, country, path) { - end <- min(end, as.character(Sys.Date() - 2)) - s <- read.csv(paste("/srv/metrics.torproject.org/metrics/shared/stats/", - "servers.csv", sep = ""), stringsAsFactors = FALSE) - s <- s[s$date >= start & s$date <= end & s$flag == '' & - s$country == ifelse(country == "all", '', country) & - s$version == '' & s$platform == '' & s$ec2bridge == '', ] - s <- data.frame(date = as.Date(s$date, "%Y-%m-%d"), relays = s$relays) - dates <- seq(from = as.Date(start, "%Y-%m-%d"), - to = as.Date(end, "%Y-%m-%d"), by="1 day") - missing <- setdiff(dates, s$date) - if (length(missing) > 0) - s <- rbind(s, - data.frame(date = as.Date(missing, origin = "1970-01-01"), - relays = NA)) - title <- ifelse(country == "all", - "Number of relays in all countries\n", - paste("Number of relays in ", countryname(country), "\n", sep = "")) - formatter <- function(x, ...) { format(x, scientific = FALSE, ...) } - date_breaks <- date_breaks( - as.numeric(max(as.Date(s$date, "%Y-%m-%d")) - - min(as.Date(s$date, "%Y-%m-%d")))) - ggplot(s, aes(x = as.Date(date, "%Y-%m-%d"), y = relays)) + - geom_line(size = 1) + - scale_x_date(name = paste("\nThe Tor Project - ", - "https://metrics.torproject.org/", sep = ""), - labels = date_format(date_breaks$format), - date_breaks = date_breaks$major, - date_minor_breaks = date_breaks$minor) + - scale_y_continuous(name = "", limits = c(0, max(s$relays, - na.rm = TRUE)), formatter = formatter) + - ggtitle(title) - ggsave(filename = path, width = 8, height = 5, dpi = 150) -} - plot_versions <- function(start, end, path) { end <- min(end, as.character(Sys.Date() - 2)) s <- read.csv(paste("/srv/metrics.torproject.org/metrics/shared/stats/",
tor-commits@lists.torproject.org