diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:57 +0000 |
commit | 00151562145df50cc65e9902d52d5fa77f89fe50 (patch) | |
tree | 2737716802f6725a5074d606ec8fe5422c58a83c /database/rrd.c | |
parent | Releasing debian version 1.34.1-1. (diff) | |
download | netdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip |
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/rrd.c')
-rw-r--r-- | database/rrd.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/database/rrd.c b/database/rrd.c index 321d35615..f91039ea5 100644 --- a/database/rrd.c +++ b/database/rrd.c @@ -2,6 +2,7 @@ #define NETDATA_RRD_INTERNALS 1 #include "rrd.h" +#include "storage_engine.h" // ---------------------------------------------------------------------------- // globals @@ -47,24 +48,19 @@ inline const char *rrd_memory_mode_name(RRD_MEMORY_MODE id) { return RRD_MEMORY_MODE_DBENGINE_NAME; } + STORAGE_ENGINE* eng = storage_engine_get(id); + if (eng) { + return eng->name; + } + return RRD_MEMORY_MODE_SAVE_NAME; } RRD_MEMORY_MODE rrd_memory_mode_id(const char *name) { - if(unlikely(!strcmp(name, RRD_MEMORY_MODE_RAM_NAME))) - return RRD_MEMORY_MODE_RAM; - - else if(unlikely(!strcmp(name, RRD_MEMORY_MODE_MAP_NAME))) - return RRD_MEMORY_MODE_MAP; - - else if(unlikely(!strcmp(name, RRD_MEMORY_MODE_NONE_NAME))) - return RRD_MEMORY_MODE_NONE; - - else if(unlikely(!strcmp(name, RRD_MEMORY_MODE_ALLOC_NAME))) - return RRD_MEMORY_MODE_ALLOC; - - else if(unlikely(!strcmp(name, RRD_MEMORY_MODE_DBENGINE_NAME))) - return RRD_MEMORY_MODE_DBENGINE; + STORAGE_ENGINE* eng = storage_engine_find(name); + if (eng) { + return eng->id; + } return RRD_MEMORY_MODE_SAVE; } @@ -139,8 +135,7 @@ const char *rrdset_type_name(RRDSET_TYPE chart_type) { // ---------------------------------------------------------------------------- // RRD - cache directory -char *rrdset_cache_dir(RRDHOST *host, const char *id, const char *config_section) { - UNUSED(config_section); +char *rrdset_cache_dir(RRDHOST *host, const char *id) { char *ret = NULL; char b[FILENAME_MAX + 1]; |