@cryptotaxi247 / netdata-1 / commits / da04e0b60

add global config option gap when lost iterations above, and removed it from each chart

Costa Tsaousis (ktsaou) committed Jan 10, 2018 at 23:36 UTC da04e0b601c47b9d90cad070dea4f4a9781a2cf3
4 files changed +6 -4
src/rrd.c
+1
@@ -14,6 +14,7 @@ int rrd_delete_unupdated_dimensions = 0;
14 int default_rrd_update_every = UPDATE_EVERY;
15 int default_rrd_history_entries = RRD_DEFAULT_HISTORY_ENTRIES;
16 RRD_MEMORY_MODE default_rrd_memory_mode = RRD_MEMORY_MODE_SAVE;
17 +int gap_when_lost_iterations_above = 1;
18
19
20 // ----------------------------------------------------------------------------
src/rrd.h
+1
@@ -9,6 +9,7 @@
9
10 extern int default_rrd_update_every;
11 extern int default_rrd_history_entries;
12 +extern int gap_when_lost_iterations_above;
13
14 #define RRD_ID_LENGTH_MAX 200
15
src/rrdhost.c
+3
@@ -407,6 +407,9 @@ restart_after_removal:
407
408 void rrd_init(char *hostname) {
409 rrdset_free_obsolete_time = config_get_number(CONFIG_SECTION_GLOBAL, "cleanup obsolete charts after seconds", rrdset_free_obsolete_time);
410 + gap_when_lost_iterations_above = (int)config_get_number(CONFIG_SECTION_GLOBAL, "gap when lost iterations above", gap_when_lost_iterations_above);
411 + if(gap_when_lost_iterations_above < 1)
412 + gap_when_lost_iterations_above = 1;
413
414 health_init();
415 registry_init();
src/rrdset.c
+1 -4
@@ -1,8 +1,6 @@
1 #define NETDATA_RRD_INTERNALS 1
2 #include "common.h"
3
4 -#define RRD_DEFAULT_GAP_INTERPOLATIONS 1
5 -
4 void __rrdset_check_rdlock(RRDSET *st, const char *file, const char *function, const unsigned long line) {
5 debug(D_RRD_CALLS, "Checking read lock on chart '%s'", st->id);
6
@@ -661,8 +659,7 @@ RRDSET *rrdset_create_custom(
659 st->last_collected_time.tv_usec = 0;
660 st->counter_done = 0;
661
664 - st->gap_when_lost_iterations_above = (int) (
665 - config_get_number(st->config_section, "gap when lost iterations above", RRD_DEFAULT_GAP_INTERPOLATIONS) + 2);
662 + st->gap_when_lost_iterations_above = (int) (gap_when_lost_iterations_above + 2);
663
664 st->last_accessed_time = 0;
665 st->upstream_resync_time = 0;