From cb85b14aef99252dc6d49ce6b52a40d4e826cae4 Mon Sep 17 00:00:00 2001 From: proton <25139420+proton-ab@users.noreply.github.com> Date: Thu, 23 Sep 2021 00:08:20 +0200 Subject: [PATCH] Use time.Truncate instead of time.Round in GetTimeFrame --- pkg/timeseries/timeseries.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/timeseries/timeseries.go b/pkg/timeseries/timeseries.go index 6a0bc2e..f265bdc 100644 --- a/pkg/timeseries/timeseries.go +++ b/pkg/timeseries/timeseries.go @@ -30,7 +30,7 @@ func (tsd *TimeSeriesData) Add(point TimePoint) *TimeSeriesData { // Gets point timestamp rounded according to provided interval. func (p *TimePoint) GetTimeFrame(interval time.Duration) time.Time { - return p.Time.Round(interval) + return p.Time.Truncate(interval) } // GroupBy groups points in given interval by applying provided `aggFunc`. Source time series should be sorted by time.