diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-05-17 16:58:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 16:58:49 +0300 |
commit | 3b8d4c21e5dd7abbc0b8b5c5b5b0bc826c229abc (patch) | |
tree | 3c54ededf79d562348d81604bfef9896aebcbd64 /database/rrdset.c | |
parent | 108bfb7918a86255bf79119f9b8eee604943ae76 (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/rrdset.c')
-rw-r--r-- | database/rrdset.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/database/rrdset.c b/database/rrdset.c index 3f1ec9fde4..0d512f8361 100644 --- a/database/rrdset.c +++ b/database/rrdset.c @@ -1798,12 +1798,8 @@ after_second_database_work: #if defined(ENABLE_ACLK) && defined(ENABLE_NEW_CLOUD_PROTOCOL) if (likely(!st->state->is_ar_chart)) { - if (!rrddim_flag_check(rd, RRDDIM_FLAG_HIDDEN) && likely(rrdset_flag_check(st, RRDSET_FLAG_ACLK))) { - int live = - ((mark - rd->last_collected_time.tv_sec) < RRDSET_MINIMUM_DIM_LIVE_MULTIPLIER * rd->update_every); - if (unlikely(live != rd->state->aclk_live_status)) - queue_dimension_to_aclk(rd); - } + if (!rrddim_flag_check(rd, RRDDIM_FLAG_HIDDEN) && likely(rrdset_flag_check(st, RRDSET_FLAG_ACLK))) + queue_dimension_to_aclk(rd, calc_dimension_liveness(rd, mark)); } #endif if(unlikely(!rd->updated)) @@ -1906,7 +1902,7 @@ after_second_database_work: } else { /* Do not delete this dimension */ #if defined(ENABLE_ACLK) && defined(ENABLE_NEW_CLOUD_PROTOCOL) - queue_dimension_to_aclk(rd); + queue_dimension_to_aclk(rd, calc_dimension_liveness(rd, mark)); #endif last = rd; rd = rd->next; |