summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-10-31 14:50:02 +0200
committerGitHub <noreply@github.com>2022-10-31 14:50:02 +0200
commit5847f56e490c11b9ca37cf9ddc05ed3241a8689f (patch)
tree3c6a6a089d352264a5a840914a20fb1c8623ae97 /database
parent9e85dc2bc98a8c7934744a239f3010cf67ef595c (diff)
timeframe matching should take into account the update frequency of the chart (#13911)
* timeframe matching should take into account the update frequency of the chart * twice update frequency is needed
Diffstat (limited to 'database')
-rw-r--r--database/rrdcontext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/database/rrdcontext.c b/database/rrdcontext.c
index 9991644e1b..937cda481e 100644
--- a/database/rrdcontext.c
+++ b/database/rrdcontext.c
@@ -2439,7 +2439,11 @@ static void query_target_add_metric(QUERY_TARGET_LOCALS *qtl, RRDMETRIC_ACQUIRED
}
}
- bool timeframe_matches = (tiers_added && common_first_time_t <= qt->window.before && common_last_time_t >= qt->window.after) ? true : false;
+ bool timeframe_matches =
+ (tiers_added
+ && (common_first_time_t - common_update_every * 2) <= qt->window.before
+ && (common_last_time_t + common_update_every * 2) >= qt->window.after
+ ) ? true : false;
if(timeframe_matches) {
RRDR_DIMENSION_FLAGS options = RRDR_DIMENSION_DEFAULT;