@cryptotaxi247 / netdata-1 / commits / b6a8e5f91

properly reset chart obsolete flag when re-generating the chart

Costa Tsaousis (ktsaou) committed Nov 3, 2017 at 14:20 UTC b6a8e5f91014b4da3a03bf78bb5e757772f7fb13
1 file changed +30 -30
src/plugins_d.c
+30 -30
@@ -295,36 +295,31 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int
295 if(unlikely(!title)) title = "";
296 if(unlikely(!units)) units = "unknown";
297
298 - st = rrdset_find_bytype(host, type, id);
299 - if(unlikely(!st)) {
300 - debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', context='%s', chart='%s', priority=%d, update_every=%d"
301 - , type, id
302 - , name?name:""
303 - , family?family:""
304 - , context?context:""
305 - , rrdset_type_name(chart_type)
306 - , priority
307 - , update_every
308 - );
309 -
310 - st = rrdset_create(
311 - host
312 - , type
313 - , id
314 - , name
315 - , family
316 - , context
317 - , title
318 - , units
319 - , (plugin && *plugin)?plugin:cd->filename
320 - , module
321 - , priority
322 - , update_every
323 - , chart_type
324 - );
325 - cd->update_every = update_every;
326 - }
327 - else debug(D_PLUGINSD, "PLUGINSD: Chart '%s' already exists. Not adding it again.", st->id);
298 + debug(D_PLUGINSD, "PLUGINSD: Creating chart type='%s', id='%s', name='%s', family='%s', context='%s', chart='%s', priority=%d, update_every=%d"
299 + , type, id
300 + , name?name:""
301 + , family?family:""
302 + , context?context:""
303 + , rrdset_type_name(chart_type)
304 + , priority
305 + , update_every
306 + );
307 +
308 + st = rrdset_create(
309 + host
310 + , type
311 + , id
312 + , name
313 + , family
314 + , context
315 + , title
316 + , units
317 + , (plugin && *plugin)?plugin:cd->filename
318 + , module
319 + , priority
320 + , update_every
321 + , chart_type
322 + );
323
324 if(options && *options) {
325 if(strstr(options, "obsolete"))
@@ -342,6 +337,11 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int
337 else
338 rrdset_flag_clear(st, RRDSET_FLAG_STORE_FIRST);
339 }
340 + else {
341 + rrdset_isnot_obsolete(st);
342 + rrdset_flag_clear(st, RRDSET_FLAG_DETAIL);
343 + rrdset_flag_clear(st, RRDSET_FLAG_STORE_FIRST);
344 + }
345 }
346 else if(likely(hash == DIMENSION_HASH && !strcmp(s, PLUGINSD_KEYWORD_DIMENSION))) {
347 char *id = words[1];