@cryptotaxi247 / netdata-1 / commits / 0272ebb01

fixed an issue that allowed to render an incomplete group of points

Costa Tsaousis (ktsaou) committed Apr 26, 2014 at 07:29 UTC 0272ebb010d7da11c4d3328a176d3e84fbc355cb
1 file changed +2 -2
netdata.c
+2 -2
@@ -1255,6 +1255,7 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1255 // make sure we return data in the proper time range
1256 if(st->times[t].tv_sec < after || st->times[t].tv_sec > before) continue;
1257 count++;
1258 + group_count++;
1259
1260 // ok. we will use this entry!
1261 // find how much usec since the previous entry
@@ -1266,7 +1267,7 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1267 break;
1268 }
1269
1269 - if(group_count != (group - 1)) {
1270 + if(group_count != group) {
1271 // this is an incomplete group, skip it.
1272 for( rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++)
1273 group_values[c] = 0;
@@ -1299,7 +1300,6 @@ unsigned long rrd_stats_json(int type, RRD_STATS *st, struct web_buffer *wb, siz
1300 }
1301 }
1302
1302 - group_count++;
1303 for( rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++) {
1304 long double oldvalue, value; // temp variable for storing data values
1305