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

[tor-commits] [metrics-web/master] Cut off last days in the bandwith graph.



commit 46009133c21cb7da39ef113d6a3bcdda984b66d9
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Sep 13 16:10:30 2011 +0200

    Cut off last days in the bandwith graph.
---
 rserve/graphs.R |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rserve/graphs.R b/rserve/graphs.R
index 3c6d72a..7f417a0 100644
--- a/rserve/graphs.R
+++ b/rserve/graphs.R
@@ -441,7 +441,8 @@ plot_bandwidth <- function(start, end, path, dpi) {
   drv <- dbDriver("PostgreSQL")
   con <- dbConnect(drv, user = dbuser, password = dbpassword, dbname = db)
   q <- paste("SELECT date, bwadvertised FROM total_bandwidth ",
-      "WHERE date >= '", start, "' AND date <= '", end, "'", sep = "")
+      "WHERE date >= '", start, "' AND date <= '", end, "' ",
+      "AND date < (SELECT MAX(date) FROM total_bandwidth) - 1 ", sep = "")
   rs <- dbSendQuery(con, q)
   bw_desc <- fetch(rs, n = -1)
   q <- paste("SELECT date, read, written FROM total_bwhist ",

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