Merge pull request #1311 from proton-ab/patch-1

Use time.Truncate instead of time.Round in GetTimeFrame
This commit is contained in:
Alexander Zobnin
2021-09-23 10:10:40 +03:00
committed by GitHub

View File

@@ -30,7 +30,7 @@ func (tsd *TimeSeriesData) Add(point TimePoint) *TimeSeriesData {
// Gets point timestamp rounded according to provided interval. // Gets point timestamp rounded according to provided interval.
func (p *TimePoint) GetTimeFrame(interval time.Duration) time.Time { 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. // GroupBy groups points in given interval by applying provided `aggFunc`. Source time series should be sorted by time.