summaryrefslogtreecommitdiffstats
path: root/aclk/aclk_query_queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'aclk/aclk_query_queue.h')
-rw-r--r--aclk/aclk_query_queue.h37
1 files changed, 35 insertions, 2 deletions
diff --git a/aclk/aclk_query_queue.h b/aclk/aclk_query_queue.h
index c4651356..db635443 100644
--- a/aclk/aclk_query_queue.h
+++ b/aclk/aclk_query_queue.h
@@ -4,7 +4,10 @@
#define NETDATA_ACLK_QUERY_QUEUE_H
#include "libnetdata/libnetdata.h"
-#include "../daemon/common.h"
+#include "daemon/common.h"
+#include "schema-wrappers/schema_wrappers.h"
+
+#include "aclk_util.h"
typedef enum {
UNKNOWN,
@@ -13,7 +16,17 @@ typedef enum {
HTTP_API_V2,
CHART_NEW,
CHART_DEL,
- ALARM_STATE_UPDATE
+ ALARM_STATE_UPDATE,
+ REGISTER_NODE,
+ NODE_STATE_UPDATE,
+ CHART_DIMS_UPDATE,
+ CHART_CONFIG_UPDATED,
+ CHART_RESET,
+ RETENTION_UPDATED,
+ UPDATE_NODE_INFO,
+ ALARM_LOG_HEALTH,
+ ALARM_PROVIDE_CFG,
+ ALARM_SNAPSHOT
} aclk_query_type_t;
struct aclk_query_metadata {
@@ -31,6 +44,13 @@ struct aclk_query_http_api_v2 {
char *query;
};
+struct aclk_bin_payload {
+ char *payload;
+ size_t size;
+ enum aclk_topics topic;
+ const char *msg_name;
+};
+
typedef struct aclk_query *aclk_query_t;
struct aclk_query {
aclk_query_type_t type;
@@ -44,6 +64,7 @@ struct aclk_query {
char *callback_topic;
char *msg_id;
+ struct timeval created_tv;
usec_t created;
aclk_query_t next;
@@ -55,6 +76,9 @@ struct aclk_query {
struct aclk_query_metadata metadata_alarms;
struct aclk_query_http_api_v2 http_api_v2;
struct aclk_query_chart_add_del chart_add_del;
+ node_instance_creation_t node_creation;
+ node_instance_connection_t node_update;
+ struct aclk_bin_payload bin_payload;
json_object *alarm_update;
} data;
};
@@ -67,5 +91,14 @@ aclk_query_t aclk_queue_pop(void);
void aclk_queue_flush(void);
void aclk_queue_lock(void);
+void aclk_queue_unlock(void);
+
+#define QUEUE_IF_PAYLOAD_PRESENT(query) \
+ if (likely(query->data.bin_payload.payload)) { \
+ aclk_queue_query(query); \
+ } else { \
+ error("Failed to generate payload (%s)", __FUNCTION__); \
+ aclk_query_free(query); \
+ }
#endif /* NETDATA_ACLK_QUERY_QUEUE_H */