mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-25 11:38:49 +03:00
Previously, the first 20 raw samples were used for calculation. But compare to the first 20 samples, the last 20 samples represent the latest state of the metrics, so the lookbehind window calculated from them should be more accurate when applied to the most recent samples, resulting in better query results for recent time ranges. For example,if the scrape interval changes at day4, and the query range is set to last 7 days. Applying the window derived from the first 20 samples(the old scrape interval) to new samples could result in consistently incorrect results from day4 through day11. Conversely, applying the window derived from the last 20 samples (the new scrape interval) could lead to incorrect results for [day0-day4), which are old states and generally less important. This pull request does not address any specific bug, but change the general behavior, so there is no changelog. Inspired by https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10280, but not the fix for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/10280.