From 8d93b15b86680eae367cee0f36f67c404e65947a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 2 Aug 2019 20:10:21 +0300 Subject: [PATCH] app/vmselect/promql: further increase the allowed jitter for scrape interval Real-world production data shows higher jitter than 1/8 of scrape interval. This may results in gaps on the graph. So increase the allowed jitter to 1/4 of scrape interval in order to reduce the probability of gaps on the graphs over time series with high jitter for scrape_interval. --- app/vmselect/promql/rollup.go | 2 +- app/vmselect/promql/rollup_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index 5a2cde4be..6099b58c8 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -234,7 +234,7 @@ func getMaxPrevInterval(timestamps []int64) int64 { return 1 } // Slightly increase d in order to handle possible jitter in scrape interval. - return d + (d / 8) + return d + (d / 4) } func removeCounterResets(values []float64) { diff --git a/app/vmselect/promql/rollup_test.go b/app/vmselect/promql/rollup_test.go index e5b621fb9..fdb79c8d3 100644 --- a/app/vmselect/promql/rollup_test.go +++ b/app/vmselect/promql/rollup_test.go @@ -454,7 +454,7 @@ func TestRollupWindowPartialPoints(t *testing.T) { } rc.Timestamps = getTimestamps(rc.Start, rc.End, rc.Step) values := rc.Do(nil, testValues, testTimestamps) - valuesExpected := []float64{44, 34, 34, nan} + valuesExpected := []float64{44, 34, 34, 34} timestampsExpected := []int64{100, 120, 140, 160} testRowsEqual(t, values, rc.Timestamps, valuesExpected, timestampsExpected) })