Browse Source

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 2 years ago
parent
commit
5847f56e49
1 changed files with 5 additions and 1 deletions
  1. 5 1
      database/rrdcontext.c

+ 5 - 1
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;