diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:33:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-11-25 17:34:10 +0000 |
commit | 83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch) | |
tree | 2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/streaming/stream-path.h | |
parent | Releasing debian version 1.47.5-1. (diff) | |
download | netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip |
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/streaming/stream-path.h')
-rw-r--r-- | src/streaming/stream-path.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/streaming/stream-path.h b/src/streaming/stream-path.h new file mode 100644 index 000000000..6dc323bdd --- /dev/null +++ b/src/streaming/stream-path.h @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef NETDATA_STREAM_PATH_H +#define NETDATA_STREAM_PATH_H + +#include "stream-capabilities.h" + +#define STREAM_PATH_JSON_MEMBER "streaming_path" + +typedef enum __attribute__((packed)) { + STREAM_PATH_FLAG_NONE = 0, + STREAM_PATH_FLAG_ACLK = (1 << 0), +} STREAM_PATH_FLAGS; + +typedef struct stream_path { + STRING *hostname; // the hostname of the agent + ND_UUID host_id; // the machine guid of the agent + ND_UUID node_id; // the cloud node id of the agent + ND_UUID claim_id; // the cloud claim id of the agent + time_t since; // the timestamp of the last update + time_t first_time_t; // the oldest timestamp in the db + int16_t hops; // -1 = stale node, 0 = localhost, >0 the hops count + STREAM_PATH_FLAGS flags; // ACLK or NONE for the moment + STREAM_CAPABILITIES capabilities; // streaming connection capabilities + uint32_t start_time; // median time in ms the agent needs to start + uint32_t shutdown_time; // median time in ms the agent needs to shutdown +} STREAM_PATH; + +typedef struct rrdhost_stream_path { + SPINLOCK spinlock; + uint16_t size; + uint16_t used; + STREAM_PATH *array; +} RRDHOST_STREAM_PATH; + + +struct rrdhost; + +void stream_path_send_to_parent(struct rrdhost *host); +void stream_path_send_to_child(struct rrdhost *host); + +void rrdhost_stream_path_to_json(BUFFER *wb, struct rrdhost *host, const char *key, bool add_version); +void rrdhost_stream_path_clear(struct rrdhost *host, bool destroy); + +void stream_path_retention_updated(struct rrdhost *host); +void stream_path_node_id_updated(struct rrdhost *host); + +void stream_path_child_disconnected(struct rrdhost *host); +void stream_path_parent_disconnected(struct rrdhost *host); +STREAM_PATH rrdhost_stream_path_fetch(struct rrdhost *host); + +bool stream_path_set_from_json(struct rrdhost *host, const char *json, bool from_parent); + +#endif //NETDATA_STREAM_PATH_H |