@cryptotaxi247 / netdata-1 / commits / 5847f56e4

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

Costa Tsaousis committed Oct 31, 2022 at 14:50 UTC 5847f56e490c11b9ca37cf9ddc05ed3241a8689f
1 file changed +5 -1
database/rrdcontext.c
+5 -1
@@ -2439,7 +2439,11 @@ static void query_target_add_metric(QUERY_TARGET_LOCALS *qtl, RRDMETRIC_ACQUIRED
2439 }
2440 }
2441
2442 - bool timeframe_matches = (tiers_added && common_first_time_t <= qt->window.before && common_last_time_t >= qt->window.after) ? true : false;
2442 + bool timeframe_matches =
2443 + (tiers_added
2444 + && (common_first_time_t - common_update_every * 2) <= qt->window.before
2445 + && (common_last_time_t + common_update_every * 2) >= qt->window.after
2446 + ) ? true : false;
2447
2448 if(timeframe_matches) {
2449 RRDR_DIMENSION_FLAGS options = RRDR_DIMENSION_DEFAULT;