summaryrefslogtreecommitdiffstats
path: root/collectors/statsd.plugin
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2023-07-26 15:30:49 +0300
committerGitHub <noreply@github.com>2023-07-26 15:30:49 +0300
commit440bd51e08fdfa2a4daa191fb68643456028a753 (patch)
tree1d2cc2b0afc24b6b77f95f2cf3a1bdbaa544e278 /collectors/statsd.plugin
parent3829b4c48ade535aa2d0a1153d45b49184b27a4b (diff)
Refactor RRD code. (#15423)
* Storage engine. * Host indexes to rrdb * Move globals to rrdb * Move storage_tiers_backfill to rrdb * default_rrd_update_every to rrdb * default_rrd_history_entries to rrdb * gap_when_lost_iterations_above to rrdb * rrdset_free_obsolete_time_s to rrdb * libuv_worker_threads to rrdb * ieee754_doubles to rrdb * rrdhost_free_orphan_time_s to rrdb * rrd_rwlock to rrdb * localhost to rrdb * rm extern from func decls * mv rrd macro under rrd.h * default_rrdeng_page_cache_mb to rrdb * default_rrdeng_extent_cache_mb to rrdb * db_engine_journal_check to rrdb * default_rrdeng_disk_quota_mb to rrdb * default_multidb_disk_quota_mb to rrdb * multidb_ctx to rrdb * page_type_size to rrdb * tier_page_size to rrdb * No storage_engine_id in rrdim functions * storage_engine_id is provided by st * Update to fix merge conflict. * Update field name * Remove unnecessary macros from rrd.h * Rm unused type decls * Rm duplicate func decls * make internal function static * Make the rest of public dbengine funcs accept a storage_instance. * No more rrdengine_instance :) * rm rrdset_debug from rrd.h * Use rrdb to access globals in ML and ACLK Missed due to not having the submodules in the worktree. * rm total_number * rm RRDVAR_TYPE_TOTAL * rm unused inline * Rm names from typedef'd enums * rm unused header include * Move include * Rm unused header include * s/rrdhost_find_or_create/rrdhost_get_or_create/g * s/find_host_by_node_id/rrdhost_find_by_node_id/ Also, remove duplicate definition in rrdcontext.c * rm macro used only once * rm macro used only once * Reduce rrd.h api by moving funcs into a collector specific utils header * Remove unused func * Move parser specific function out of rrd.h * return storage_number instead of void pointer * move code related to rrd initialization out of rrdhost.c * Remove tier_grouping from rrdim_tier Saves 8 * storage_tiers bytes per dimension. * Fix rebase * s/rrd_update_every/update_every/ * Mark functions as static and constify args * Add license notes and file to build systems. * Remove remaining non-log/config mentions of memory mode * Move rrdlabels api to separate file. Also, move localhost functions that loads labels outside of database/ and into daemon/ * Remove function decl in rrd.h * merge rrdhost_cache_dir_for_rrdset_alloc into rrdset_cache_dir * Do not expose internal function from rrd.h * Rm NETDATA_RRD_INTERNALS Only one function decl is covered. We have more database internal functions that we currently expose for no good reason. These will be placed in a separate internal header in follow up PRs. * Add license note * Include libnetdata.h instead of aral.h * Use rrdb to access localhost * Fix builds without dbengine * Add header to build system files * Add rrdlabels.h to build systems * Move func def from rrd.h to rrdhost.c * Fix macos build * Rm non-existing function * Rebase master * Define buffer length macro in ad_charts. * Fix FreeBSD builds. * Mark functions static * Rm func decls without definitions * Rebase master * Rebase master * Properly initialize value of storage tiers. * Fix build after rebase.
Diffstat (limited to 'collectors/statsd.plugin')
-rw-r--r--collectors/statsd.plugin/statsd.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/collectors/statsd.plugin/statsd.c b/collectors/statsd.plugin/statsd.c
index 5422d29059..549d7845c1 100644
--- a/collectors/statsd.plugin/statsd.c
+++ b/collectors/statsd.plugin/statsd.c
@@ -218,7 +218,7 @@ typedef struct statsd_app {
const char *name;
SIMPLE_PATTERN *metrics;
STATS_METRIC_OPTIONS default_options;
- RRD_MEMORY_MODE rrd_memory_mode;
+ STORAGE_ENGINE_ID storage_engine_id;
int32_t rrd_history_entries;
DICTIONARY *dict;
@@ -1296,8 +1296,8 @@ static int statsd_readfile(const char *filename, STATSD_APP *app, STATSD_APP_CHA
// a new app
app = callocz(sizeof(STATSD_APP), 1);
app->name = strdupz("unnamed");
- app->rrd_memory_mode = localhost->rrd_memory_mode;
- app->rrd_history_entries = localhost->rrd_history_entries;
+ app->storage_engine_id = rrdb.localhost->storage_engine_id;
+ app->rrd_history_entries = rrdb.localhost->rrd_history_entries;
app->next = statsd.apps;
statsd.apps = app;
@@ -1409,7 +1409,6 @@ static int statsd_readfile(const char *filename, STATSD_APP *app, STATSD_APP_CHA
else if (!strcmp(name, "memory mode")) {
// this is not supported anymore
// with the implementation of storage engines, all charts have the same storage engine always
- // app->rrd_memory_mode = rrd_memory_mode_id(value);
;
}
else if (!strcmp(name, "history")) {
@@ -1599,7 +1598,7 @@ static inline RRDSET *statsd_private_rrdset_create(
statsd.private_charts++;
RRDSET *st = rrdset_create_custom(
- localhost // host
+ rrdb.localhost // host
, type // type
, id // id
, name // name
@@ -1612,8 +1611,8 @@ static inline RRDSET *statsd_private_rrdset_create(
, priority // priority
, update_every // update every
, chart_type // chart type
- , default_rrd_memory_mode // memory mode
- , default_rrd_history_entries // history
+ , default_storage_engine_id // storage_engine_id
+ , rrdb.default_rrd_history_entries // history
);
rrdset_flag_set(st, RRDSET_FLAG_STORE_FIRST);
@@ -2204,7 +2203,7 @@ static inline void statsd_update_app_chart(STATSD_APP *app, STATSD_APP_CHART *ch
if(!chart->st) {
chart->st = rrdset_create_custom(
- localhost // host
+ rrdb.localhost // host
, app->name // type
, chart->id // id
, chart->name // name
@@ -2217,7 +2216,7 @@ static inline void statsd_update_app_chart(STATSD_APP *app, STATSD_APP_CHART *ch
, chart->priority // priority
, statsd.update_every // update every
, chart->chart_type // chart type
- , app->rrd_memory_mode // memory mode
+ , app->storage_engine_id // storage engine id
, app->rrd_history_entries // history
);
@@ -2432,11 +2431,11 @@ void *statsd_main(void *ptr) {
statsd.enabled = config_get_boolean(CONFIG_SECTION_PLUGINS, "statsd", statsd.enabled);
- statsd.update_every = default_rrd_update_every;
+ statsd.update_every = rrdb.default_update_every;
statsd.update_every = (int)config_get_number(CONFIG_SECTION_STATSD, "update every (flushInterval)", statsd.update_every);
- if(statsd.update_every < default_rrd_update_every) {
- collector_error("STATSD: minimum flush interval %d given, but the minimum is the update every of netdata. Using %d", statsd.update_every, default_rrd_update_every);
- statsd.update_every = default_rrd_update_every;
+ if(statsd.update_every < rrdb.default_update_every) {
+ collector_error("STATSD: minimum flush interval %d given, but the minimum is the update every of netdata. Using %d", statsd.update_every, rrdb.default_update_every);
+ statsd.update_every = rrdb.default_update_every;
}
#ifdef HAVE_RECVMMSG