]> arthur.barton.de Git - netdata.git/commitdiff
fixed padding in agregated charts
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 6 Jun 2014 12:45:38 +0000 (15:45 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 6 Jun 2014 12:45:38 +0000 (15:45 +0300)
netdata.c

index bbba213b060ed180e5d627ae1a44f3d08fb96308..d10b05330cb9cfb1243e28b16151f2c0078a83e9 100755 (executable)
--- a/netdata.c
+++ b/netdata.c
@@ -2525,10 +2525,11 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, int
        // find the oldest entry of the round-robin
        long max_entries_init = (st->counter < (unsigned long)st->entries) ? st->counter : (unsigned long)st->entries;
        
-       if(before == 0) before = st->last_updated.tv_sec;
+       time_t time_init = st->last_updated.tv_sec;
+       
+       if(before == 0 || before > time_init) before = time_init;
        if(after  == 0) after = rrd_stats_first_entry_t(st);
 
-       time_t time_init = st->last_updated.tv_sec;
 
        // ---