diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:49:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:49:55 +0000 |
commit | ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb (patch) | |
tree | 7a900833aad3ccc685712c6c2a7d87576d54f427 /database/contexts/internal.h | |
parent | Adding upstream version 1.40.1. (diff) | |
download | netdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.tar.xz netdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.zip |
Adding upstream version 1.41.0.upstream/1.41.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | database/contexts/internal.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/database/contexts/internal.h b/database/contexts/internal.h index 9917d58e4..c5663dd24 100644 --- a/database/contexts/internal.h +++ b/database/contexts/internal.h @@ -250,6 +250,8 @@ typedef struct rrdcontext { uint32_t priority; RRDSET_TYPE chart_type; + SPINLOCK spinlock; + RRD_FLAGS flags; time_t first_time_s; time_t last_time_s; @@ -275,7 +277,9 @@ typedef struct rrdcontext { size_t dispatches; // the number of times this has been dispatched to hub } queue; - netdata_mutex_t mutex; + struct { + uint32_t metrics; // the number of metrics in this context + } stats; } RRDCONTEXT; @@ -352,8 +356,8 @@ static inline void rrdcontext_release(RRDCONTEXT_ACQUIRED *rca) { void rrdcontext_recalculate_context_retention(RRDCONTEXT *rc, RRD_FLAGS reason, bool worker_jobs); void rrdcontext_recalculate_host_retention(RRDHOST *host, RRD_FLAGS reason, bool worker_jobs); -#define rrdcontext_lock(rc) netdata_mutex_lock(&((rc)->mutex)) -#define rrdcontext_unlock(rc) netdata_mutex_unlock(&((rc)->mutex)) +#define rrdcontext_lock(rc) spinlock_lock(&((rc)->spinlock)) +#define rrdcontext_unlock(rc) spinlock_unlock(&((rc)->spinlock)) void rrdinstance_trigger_updates(RRDINSTANCE *ri, const char *function); void rrdcontext_trigger_updates(RRDCONTEXT *rc, const char *function); |