365
debug(D_RRD_CALLS, "RRDSET: Cleaning up remaining chart variables for host '%s', chart '%s'", host->hostname, st->id);
366
rrdvar_free_remaining_variables(host, &st->rrdvar_root_index);
367
368
- // ------------------------------------------------------------------------
369
- // remove it from the configuration
370
-
371
- appconfig_section_destroy_non_loaded(&netdata_config, st->config_section);
372
-
368
// ------------------------------------------------------------------------
369
// unlink it from the host
370
397
freez(st->units);
398
freez(st->context);
399
freez(st->cache_dir);
405
- freez(st->config_section);
400
freez(st->plugin_name);
401
freez(st->module_name);
402
freez(st->state->old_title);
706
707
char fullfilename[FILENAME_MAX + 1];
708
715
- // ------------------------------------------------------------------------
716
- // compose the config_section for this chart
717
-
718
- char config_section[RRD_ID_LENGTH_MAX + GUID_LEN + 2];
719
- if(host == localhost)
720
- strcpy(config_section, fullid);
721
- else
722
- snprintfz(config_section, RRD_ID_LENGTH_MAX + GUID_LEN + 1, "%s/%s", host->machine_guid, fullid);
723
-
709
// ------------------------------------------------------------------------
710
// get the options from the config, we need to create it
711
727
- long entries;
728
- int enabled = config_get_boolean(config_section, "enabled", 1);
729
- if(!enabled || memory_mode == RRD_MEMORY_MODE_DBENGINE)
730
- entries = 5;
731
- else
712
+ long entries = 5;
713
+ if (memory_mode != RRD_MEMORY_MODE_DBENGINE)
714
entries = align_entries_to_pagesize(memory_mode, history_entries);
715
716
unsigned long size = sizeof(RRDSET);
735
- char *cache_dir = rrdset_cache_dir(host, fullid, config_section);
717
+ char *cache_dir = rrdset_cache_dir(host, fullid);
718
719
time_t now = now_realtime_sec();
720
740
memset(&st->rrdset_rwlock, 0, sizeof(netdata_rwlock_t));
741
742
st->name = NULL;
761
- st->config_section = NULL;
743
st->type = NULL;
744
st->family = NULL;
745
st->title = NULL;
812
st->plugin_name = plugin?strdupz(plugin):NULL;
813
st->module_name = module?strdupz(module):NULL;
814
834
- st->config_section = strdupz(config_section);
815
st->rrdhost = host;
816
st->memsize = size;
817
st->entries = entries;
846
st->hash_context = simple_hash(st->context);
847
848
st->priority = priority;
869
- if(enabled)
870
- rrdset_flag_set(st, RRDSET_FLAG_ENABLED);
871
- else
872
- rrdset_flag_clear(st, RRDSET_FLAG_ENABLED);
849
850
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
851