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

karsten at torproject.org karsten at torproject.org
Tue Sep 13 14:14:58 UTC 2011


commit 46009133c21cb7da39ef113d6a3bcdda984b66d9
Author: Karsten Loesing <karsten.loesing at gmx.net>
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 ",



More information about the tor-commits mailing list