diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-03-31 21:19:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 21:19:34 +0200 |
commit | 8fe7485a600f60be9ac20af923a61d516cb0335e (patch) | |
tree | 875658393d501b764eb8694d44488dbe9b64cf29 /database | |
parent | ef2bd3956b2797de31008ddffab671b9675f070d (diff) |
Switching over to soft feature flag (#8545)
Preparing for the cloud release. This changes how we handle the feature flag so that it no longer requires installer switches and can be set from the config file. This still requires internal access to use and is not ready for public access yet.
Diffstat (limited to 'database')
-rw-r--r-- | database/rrddim.c | 21 | ||||
-rw-r--r-- | database/rrdset.c | 12 |
2 files changed, 22 insertions, 11 deletions
diff --git a/database/rrddim.c b/database/rrddim.c index 11f43ab321..3e94021e78 100644 --- a/database/rrddim.c +++ b/database/rrddim.c @@ -184,7 +184,8 @@ void rrdcalc_link_to_rrddim(RRDDIM *rd, RRDSET *st, RRDHOST *host) { } } #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif } @@ -428,7 +429,8 @@ RRDDIM *rrddim_add_custom(RRDSET *st, const char *id, const char *name, collecte } rrdset_unlock(st); #ifdef ENABLE_ACLK - aclk_update_chart(host, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(host, st->id, ACLK_CMD_CHART); #endif return(rd); } @@ -484,7 +486,8 @@ void rrddim_free(RRDSET *st, RRDDIM *rd) break; } #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif } @@ -505,7 +508,8 @@ int rrddim_hide(RRDSET *st, const char *id) { rrddim_flag_set(rd, RRDDIM_FLAG_HIDDEN); #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif return 0; } @@ -522,7 +526,8 @@ int rrddim_unhide(RRDSET *st, const char *id) { rrddim_flag_clear(rd, RRDDIM_FLAG_HIDDEN); #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif return 0; } @@ -533,7 +538,8 @@ inline void rrddim_is_obsolete(RRDSET *st, RRDDIM *rd) { rrddim_flag_set(rd, RRDDIM_FLAG_OBSOLETE); rrdset_flag_set(st, RRDSET_FLAG_OBSOLETE_DIMENSIONS); #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif } @@ -542,7 +548,8 @@ inline void rrddim_isnot_obsolete(RRDSET *st __maybe_unused, RRDDIM *rd) { rrddim_flag_clear(rd, RRDDIM_FLAG_OBSOLETE); #ifdef ENABLE_ACLK - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHART); #endif } diff --git a/database/rrdset.c b/database/rrdset.c index ced1021ac7..d0554f0f30 100644 --- a/database/rrdset.c +++ b/database/rrdset.c @@ -425,8 +425,10 @@ void rrdset_delete(RRDSET *st) { recursively_delete_dir(st->cache_dir, "left-over chart"); #ifdef ENABLE_ACLK - aclk_del_collector(st->rrdhost->hostname, st->plugin_name, st->module_name); - aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHARTDEL); + if (netdata_cloud_setting) { + aclk_del_collector(st->rrdhost->hostname, st->plugin_name, st->module_name); + aclk_update_chart(st->rrdhost, st->id, ACLK_CMD_CHARTDEL); + } #endif } @@ -768,8 +770,10 @@ RRDSET *rrdset_create_custom( rrdhost_unlock(host); #ifdef ENABLE_ACLK - aclk_add_collector(host->hostname, plugin, module); - aclk_update_chart(host, st->id, ACLK_CMD_CHART); + if (netdata_cloud_setting) { + aclk_add_collector(host->hostname, plugin, module); + aclk_update_chart(host, st->id, ACLK_CMD_CHART); + } #endif return(st); } |