summaryrefslogtreecommitdiffstats
path: root/daemon/global_statistics.c
diff options
context:
space:
mode:
authorAdrien BĂ©raud <adrien.beraud@savoirfairelinux.com>2022-06-16 09:53:35 -0400
committerGitHub <noreply@github.com>2022-06-16 16:53:35 +0300
commit100a12c6cc01222b1518e5e50d2147f592d8a111 (patch)
tree1aa8f4a5f94f05dd10a07634e60544a523ba75fd /daemon/global_statistics.c
parent131e5f5f6e5822a1fd8107c228f1a9a49f08e847 (diff)
Configurable storage engine for Netdata agents: step 3 (#12892)
* storage engine: add host context API Add a new API to allow storage engines to manage host contexts. * Replace single global context with per-engine global context * Context is full managed by storage engines: a storage engine can use no context, a global engine context, per host contexts, or a mix of these. * Currently, only dbengine uses contexts. Following the current logic, legacy hosts use their own context, while non-legacy hosts share the global context. * storage engine: use empty function instead of null for context ops * rrdhost: don't check return value for void call * rrdhost: create context with host * storage engine: move rrddim ops to rrddim_mem.{c,h} * storage engine: don't use NULL for end-of-list marker * storage engine: fallback to default engine
Diffstat (limited to 'daemon/global_statistics.c')
-rw-r--r--daemon/global_statistics.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon/global_statistics.c b/daemon/global_statistics.c
index b5740b176f..a5f7094d54 100644
--- a/daemon/global_statistics.c
+++ b/daemon/global_statistics.c
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "common.h"
+#ifdef ENABLE_DBENGINE
+#include "database/engine/rrdengineapi.h"
+#endif
#define GLOBAL_STATS_RESET_WEB_USEC_MAX 0x01
@@ -456,7 +459,7 @@ static void dbengine_statistics_charts(void) {
rrdhost_foreach_read(host) {
if (host->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE && !rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED)) {
- if (&multidb_ctx == host->rrdeng_ctx) {
+ if (host->rrdeng_ctx == host->rrdeng_ctx->engine->context) {
if (counted_multihost_db)
continue; /* Only count multi-host DB once */
counted_multihost_db = 1;