[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Cut off enough days from direct/bridge user graphs.
commit 4d68e1420c2615b94e51f2405ba663da3d051312
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Mon Aug 13 12:05:28 2012 +0200
Cut off enough days from direct/bridge user graphs.
Fixes #6593.
---
rserve/csv.R | 4 ++--
rserve/graphs.R | 4 ++--
rserve/tables.R | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/rserve/csv.R b/rserve/csv.R
index eec76d9..44c6495 100644
--- a/rserve/csv.R
+++ b/rserve/csv.R
@@ -153,7 +153,7 @@ export_direct_users <- function(path) {
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
q <- paste("SELECT date, country, r, bwp, brn, bwn, brp, bwr, brr",
- "FROM user_stats WHERE date < current_date - 1",
+ "FROM user_stats WHERE date < current_date - 3",
"ORDER BY date, country")
rs <- dbSendQuery(con, q)
u <- fetch(rs, n = -1)
@@ -171,7 +171,7 @@ export_bridge_users <- function(path) {
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
q <- paste("SELECT date, country, users AS bridgeusers",
- "FROM bridge_stats WHERE date < current_date - 1",
+ "FROM bridge_stats WHERE date < current_date - 3",
"ORDER BY date, country")
rs <- dbSendQuery(con, q)
bridgeusers <- fetch(rs, n = -1)
diff --git a/rserve/graphs.R b/rserve/graphs.R
index 87917aa..4f444b3 100644
--- a/rserve/graphs.R
+++ b/rserve/graphs.R
@@ -671,7 +671,7 @@ plot_direct_users <- function(start, end, country, events, path, nocutoff,
q <- paste("SELECT date, r, bwp, brn, bwn, brp, bwr, brr, country ",
"FROM user_stats WHERE date >= '", start, "' AND date <= '", end,
"' ", ifelse(nocutoff == "off",
- " AND date < current_date - 1 ", ""),
+ " AND date < current_date - 3 ", ""),
" AND (country = 'zy'", ifelse(country == "all", "",
paste(" OR country = '", country, "'", sep = "")), ")", sep = "")
rs <- dbSendQuery(con, q)
@@ -747,7 +747,7 @@ plot_bridge_users <- function(start, end, country, path, dpi) {
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
q <- paste("SELECT date, users FROM bridge_stats ",
"WHERE date >= '", start, "' AND date <= '", end, "' ",
- "AND date < current_date - 1",
+ "AND date < current_date - 3",
" AND country = '", ifelse(country == "all", "zy", country), "'",
sep = "")
rs <- dbSendQuery(con, q)
diff --git a/rserve/tables.R b/rserve/tables.R
index cb74379..8817112 100644
--- a/rserve/tables.R
+++ b/rserve/tables.R
@@ -7,7 +7,7 @@ write_direct_users <- function(start, end, path) {
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
q <- paste("SELECT date, country, r, bwp, brn, bwn, brp, bwr, brr ",
"FROM user_stats WHERE date >= '", start, "' AND date <= '", end,
- "' AND date < current_date - 1 ORDER BY date, country", sep = "")
+ "' AND date < current_date - 3 ORDER BY date, country", sep = "")
rs <- dbSendQuery(con, q)
u <- fetch(rs, n = -1)
dbDisconnect(con)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits