go-graphite / carbonapi

Implementation of graphite API (graphite-web) in golang
Other
309 stars 140 forks source link

Fix holtWinters* functions handling of the bootstrapInterval parameter #775

Closed carrieedwards closed 1 year ago

carrieedwards commented 1 year ago

The bootstrapInterval parameter in the holtWinters functions is not being handled correctly. An issue is occurring when a bootstrapInterval that is not the default value of 7d is specified. In parser.go, the start time for holtWinters functions is adjusted by subtracting 7 86400 (equivalent to 7 days), prior to the data being fetched. This is not taking the bootstrapInterval from the query into account, and is just applying the default value. However, if the bootstrapInterval is set to a different value, then inside of the holtWinters functions, the from time is adjusted to the specified bootstrap interval, but the new starting time does not match the data that was previously fetched. This caused nil results to be returned. Instead, the specified bootstrapInterval (when included in the query) should be factoring in when adjusting the from time prior to fetching data.