diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-09-07 15:28:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 15:28:30 +0300 |
commit | 3f6a75250d8251b0142248ed2f33f7d857ee21c8 (patch) | |
tree | f8fd7544a2fb509b295e6bd5267baab6014bc787 /database/rrd.h | |
parent | 17e0676b5bb6b11ad9aec705ade05163dcc2de31 (diff) |
Obsolete RRDSET state (#13635)
* move chart_labels to rrdset
* rename chart_labels to rrdlabels
* renamed hash_id to uuid
* turned is_ar_chart into an rrdset flag
* removed rrdset state
* removed unused senders_connected member of rrdhost
* removed unused host flag RRDHOST_FLAG_MULTIHOST
* renamed rrdhost host_labels to rrdlabels
* Update exporting unit tests
Co-authored-by: Vladimir Kobal <vlad@prokk.net>
Diffstat (limited to 'database/rrd.h')
-rw-r--r-- | database/rrd.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/database/rrd.h b/database/rrd.h index 4c3b13dfb1..f473e308ac 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -445,14 +445,6 @@ struct rrddim_tier { extern void rrdr_fill_tier_gap_from_smaller_tiers(RRDDIM *rd, int tier, time_t now); // ---------------------------------------------------------------------------- -// volatile state per chart -struct rrdset_volatile { - uuid_t hash_id; - DICTIONARY *chart_labels; - bool is_ar_chart; -}; - -// ---------------------------------------------------------------------------- // these loop macros make sure the linked list is accessed with the right lock #define rrddim_foreach_read(rd, st) \ @@ -491,15 +483,21 @@ typedef enum rrdset_flags { RRDSET_FLAG_ACLK = (1 << 16), RRDSET_FLAG_PENDING_FOREACH_ALARMS = (1 << 17), // contains dims with uninitialized foreach alarms RRDSET_FLAG_ANOMALY_DETECTION = (1 << 18), // flag to identify anomaly detection charts. - RRDSET_FLAG_INDEXED_ID = (1 << 19), - RRDSET_FLAG_INDEXED_NAME = (1 << 20), + RRDSET_FLAG_INDEXED_ID = (1 << 19), // the rrdset is indexed by its id + RRDSET_FLAG_INDEXED_NAME = (1 << 20), // the rrdset is indexed by its name + + RRDSET_FLAG_ANOMALY_RATE_CHART = (1 << 21), // the rrdset is for storing anomaly rates for all dimensions } RRDSET_FLAGS; #define rrdset_flag_check(st, flag) (__atomic_load_n(&((st)->flags), __ATOMIC_SEQ_CST) & (flag)) #define rrdset_flag_set(st, flag) __atomic_or_fetch(&((st)->flags), flag, __ATOMIC_SEQ_CST) #define rrdset_flag_clear(st, flag) __atomic_and_fetch(&((st)->flags), ~(flag), __ATOMIC_SEQ_CST) +#define rrdset_is_ar_chart(st) rrdset_flag_check(st, RRDSET_FLAG_ANOMALY_RATE_CHART) + struct rrdset { + uuid_t uuid; + // ------------------------------------------------------------------------ // the set configuration @@ -550,8 +548,6 @@ struct rrdset { uuid_t *chart_uuid; // Store the global GUID for this chart // this object. - struct rrdset_volatile *state; // volatile state that is not persistently stored - size_t rrddim_page_alignment; // keeps metric pages in alignment when using dbengine usec_t usec_since_last_update; // the time in microseconds since the last collection of data @@ -585,6 +581,11 @@ struct rrdset { void *st_on_file; // compatibility with V019 RRDSET files // ------------------------------------------------------------------------ + // chart labels + + DICTIONARY *rrdlabels; + + // ------------------------------------------------------------------------ // the dimensions DICTIONARY *rrddim_root_index; // the root of the dimensions index @@ -638,7 +639,6 @@ typedef enum rrdhost_flags { RRDHOST_FLAG_EXPORTING_SEND = (1 << 3), // send it to external databases RRDHOST_FLAG_EXPORTING_DONT_SEND = (1 << 4), // don't send it to external databases RRDHOST_FLAG_ARCHIVED = (1 << 5), // The host is archived, no collected charts yet - RRDHOST_FLAG_MULTIHOST = (1 << 6), // Host belongs to localhost/megadb RRDHOST_FLAG_PENDING_FOREACH_ALARMS = (1 << 7), // contains dims with uninitialized foreach alarms RRDHOST_FLAG_STREAM_LABELS_UPDATE = (1 << 8), RRDHOST_FLAG_STREAM_LABELS_STOP = (1 << 9), @@ -842,9 +842,6 @@ struct rrdhost { // ------------------------------------------------------------------------ // streaming of data from remote hosts - rrdpush - volatile size_t connected_senders; // when remote hosts are streaming to this - // host, this is the counter of connected clients - time_t senders_connect_time; // the time the last sender was connected time_t senders_last_chart_command; // the time of the last CHART streaming command time_t senders_disconnected_time; // the time the last sender was disconnected @@ -903,7 +900,7 @@ struct rrdhost { // ------------------------------------------------------------------------ // Support for host-level labels - DICTIONARY *host_labels; + DICTIONARY *rrdlabels; // ------------------------------------------------------------------------ // indexes |