[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Make the dirbytes graph look at start/end parameters.
commit 2b533a8eb4406b9e9651c7b0f0690b0a56b12782
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu Dec 29 17:27:41 2011 +0100
Make the dirbytes graph look at start/end parameters.
Bug found by rransom.
---
rserve/graphs.R | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/rserve/graphs.R b/rserve/graphs.R
index c8265c3..886fabf 100644
--- a/rserve/graphs.R
+++ b/rserve/graphs.R
@@ -523,9 +523,11 @@ plot_bwhist_flags <- function(start, end, path, dpi) {
plot_dirbytes <- function(start, end, path, dpi) {
drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
- q <- paste("SELECT date, dr, dw, brp, bwp, brd, bwd FROM user_stats",
- "WHERE country = 'zy' AND bwp / bwd <= 3",
- "AND date < (SELECT MAX(date) FROM user_stats) - 1 ORDER BY date")
+ q <- paste("SELECT date, dr, dw, brp, bwp, brd, bwd FROM user_stats ",
+ "WHERE country = 'zy' AND bwp / bwd <= 3 AND date >= '", start,
+ "' AND date <= '", end, "' ",
+ "AND date < (SELECT MAX(date) FROM user_stats) - 1 ORDER BY date",
+ sep = "")
rs <- dbSendQuery(con, q)
dir <- fetch(rs, n = -1)
dbDisconnect(con)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits