prevent spikes on the charts when restarting netdata
Costa Tsaousis committed
Aug 23, 2016 at 00:50 UTC
30d362657debb8228892e4f1b7e5e2447d91b5e3
1 file changed
+10
-2
src/rrd.c
+10
-2
@@ -494,6 +494,7 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
494
st = callocz(1, size);
495
st->mapped = RRD_MEMORY_MODE_RAM;
496
}
497
+
498
st->memsize = size;
499
st->entries = entries;
500
st->update_every = update_every;
@@ -522,6 +523,12 @@ RRDSET *rrdset_create(const char *type, const char *id, const char *name, const
523
st->isdetail = 0;
524
st->debug = 0;
525
526
+ // if(!strcmp(st->id, "disk_util.dm-0")) {
527
+ // st->debug = 1;
528
+ // error("enabled debugging for '%s'", st->id);
529
+ // }
530
+ // else error("not enabled debugging for '%s'", st->id);
531
+
532
st->green = NAN;
533
st->red = NAN;
534
@@ -679,6 +686,7 @@ RRDDIM *rrddim_add(RRDSET *st, const char *id, const char *name, long multiplier
686
rd->last_collected_value = 0;
687
rd->collected_volume = 0;
688
rd->stored_volume = 0;
689
+ rd->last_stored_value = 0;
690
rd->values[st->current_entry] = pack_storage_number(0, SN_NOT_EXISTS);
691
rd->last_collected_time.tv_sec = 0;
692
rd->last_collected_time.tv_usec = 0;
@@ -1336,7 +1344,7 @@ unsigned long long rrdset_done(RRDSET *st)
1344
}
1345
1346
if(unlikely(!store_this_entry)) {
1339
- store_this_entry = 1;
1347
+ // store_this_entry = 1;
1348
continue;
1349
}
1350
@@ -1358,7 +1366,7 @@ unsigned long long rrdset_done(RRDSET *st)
1366
, st->current_entry
1367
);
1368
rd->values[st->current_entry] = pack_storage_number(0, SN_NOT_EXISTS);
1361
- rd->last_stored_value = 0;
1369
+ rd->last_stored_value = NAN;
1370
}
1371
1372
stored_entries++;