Closed carrieedwards closed 1 year ago
Describe the bug If the interval parameter passed into the hitcount() function is smaller than the step of the data, the results are incorrect. The results will be shifted left, and buckets to the right will be empty.
For example:
hitcount(metric1, "6m") []*types.MetricData{{"metric1", 0, 1}: {types.MakeMetricData("metric1", []float64{2, 4, 6}, 600, 100)},} // 10m step
hitcount(metric1, "6m")
[]*types.MetricData{{"metric1", 0, 1}: {types.MakeMetricData("metric1", []float64{2, 4, 6}, 600, 100)},}
The result will be []float64{1200, 2400, 3600, 0, 0, 0}. The hit values are all concentrated on the left half of the buckets.
When the same test is run in Graphite web, the results are [720, 960, 1440, 1920, 2160], with the hit values spread throughout all of the buckets.
Describe the bug If the interval parameter passed into the hitcount() function is smaller than the step of the data, the results are incorrect. The results will be shifted left, and buckets to the right will be empty.
For example:
hitcount(metric1, "6m")
[]*types.MetricData{{"metric1", 0, 1}: {types.MakeMetricData("metric1", []float64{2, 4, 6}, 600, 100)},}
// 10m stepThe result will be []float64{1200, 2400, 3600, 0, 0, 0}. The hit values are all concentrated on the left half of the buckets.
When the same test is run in Graphite web, the results are [720, 960, 1440, 1920, 2160], with the hit values spread throughout all of the buckets.