summaryrefslogtreecommitdiffstats
path: root/database/sqlite/sqlite_aclk_chart.h
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2022-05-17 16:58:49 +0300
committerGitHub <noreply@github.com>2022-05-17 16:58:49 +0300
commit3b8d4c21e5dd7abbc0b8b5c5b5b0bc826c229abc (patch)
tree3c54ededf79d562348d81604bfef9896aebcbd64 /database/sqlite/sqlite_aclk_chart.h
parent108bfb7918a86255bf79119f9b8eee604943ae76 (diff)
Adjust the dimension liveness status check (#12933)
* Mark a chart to be exposed only if dimension is created or metadata changes * Add a calculate liveness for the dimension for collected to non collected (live -> stale) and vice versa * queue_dimension_to_aclk will have the rrdset and either 0 or last collected time If 0 then it will be marked as live else it will be marked as stale and last collected time will be sent to the cloud * Add an extra parameter to indicate if the payload check should be done in the database or it has been done already * Queue dimension sets dimension liveness and queues the exact payload to store in the database * Fix compilation error when --disable-cloud is specified
Diffstat (limited to 'database/sqlite/sqlite_aclk_chart.h')
-rw-r--r--database/sqlite/sqlite_aclk_chart.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/database/sqlite/sqlite_aclk_chart.h b/database/sqlite/sqlite_aclk_chart.h
index 75aff3af30..f98cf55c5c 100644
--- a/database/sqlite/sqlite_aclk_chart.h
+++ b/database/sqlite/sqlite_aclk_chart.h
@@ -16,10 +16,20 @@ extern sqlite3 *db_meta;
#define RRDSET_MINIMUM_DIM_LIVE_MULTIPLIER (3)
#endif
+#ifndef RRDSET_MINIMUM_DIM_OFFLINE_MULTIPLIER
+#define RRDSET_MINIMUM_DIM_OFFLINE_MULTIPLIER (30)
+#endif
+
#ifndef ACLK_MAX_DIMENSION_CLEANUP
#define ACLK_MAX_DIMENSION_CLEANUP (500)
#endif
+struct aclk_chart_dimension_data {
+ uuid_t uuid;
+ char *payload;
+ size_t payload_size;
+};
+
struct aclk_chart_sync_stats {
int updates;
uint64_t batch_id;
@@ -37,7 +47,7 @@ struct aclk_chart_sync_stats {
};
extern int queue_chart_to_aclk(RRDSET *st);
-extern void queue_dimension_to_aclk(RRDDIM *rd);
+extern void queue_dimension_to_aclk(RRDDIM *rd, time_t last_updated);
extern void sql_create_aclk_table(RRDHOST *host, uuid_t *host_uuid, uuid_t *node_id);
int aclk_add_chart_event(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd);
int aclk_add_dimension_event(struct aclk_database_worker_config *wc, struct aclk_database_cmd cmd);