diff --git a/util/stats/query_stats.go b/util/stats/query_stats.go index b1c91a69fd..0e0e1871c3 100644 --- a/util/stats/query_stats.go +++ b/util/stats/query_stats.go @@ -182,7 +182,7 @@ func (qs *QuerySamples) totalSamplesPerStepPoints() []stepStat { ts := make([]stepStat, len(qs.TotalSamplesPerStep)) for i, c := range qs.TotalSamplesPerStep { - ts[i] = stepStat{T: qs.startTimestamp + int64(i)*qs.interval, V: c} + ts[i] = stepStat{T: qs.StartTimestamp + int64(i)*qs.Interval, V: c} } return ts } @@ -246,8 +246,8 @@ type QuerySamples struct { TotalSamplesPerStep []int64 EnablePerStepStats bool - startTimestamp int64 - interval int64 + StartTimestamp int64 + Interval int64 } type Stats struct { @@ -262,8 +262,8 @@ func (qs *QuerySamples) InitStepTracking(start, end, interval int64) { numSteps := int((end-start)/interval) + 1 qs.TotalSamplesPerStep = make([]int64, numSteps) - qs.startTimestamp = start - qs.interval = interval + qs.StartTimestamp = start + qs.Interval = interval } // IncrementSamplesAtStep increments the total samples count. Use this if you know the step index. @@ -287,7 +287,7 @@ func (qs *QuerySamples) IncrementSamplesAtTimestamp(t, samples int64) { qs.TotalSamples += samples if qs.TotalSamplesPerStep != nil { - i := int((t - qs.startTimestamp) / qs.interval) + i := int((t - qs.StartTimestamp) / qs.Interval) qs.TotalSamplesPerStep[i] += samples } }