@@ -18,6 +18,7 @@ import (
18
18
"github.com/prometheus/prometheus/promql"
19
19
"github.com/prometheus/prometheus/scrape"
20
20
"github.com/prometheus/prometheus/storage"
21
+ "github.com/prometheus/prometheus/tsdb/tsdbutil"
21
22
"github.com/prometheus/prometheus/util/annotations"
22
23
"github.com/stretchr/testify/assert"
23
24
"github.com/stretchr/testify/mock"
@@ -34,7 +35,6 @@ import (
34
35
"github.com/cortexproject/cortex/pkg/util"
35
36
"github.com/cortexproject/cortex/pkg/util/chunkcompat"
36
37
"github.com/cortexproject/cortex/pkg/util/flagext"
37
- histogram_util "github.com/cortexproject/cortex/pkg/util/histogram"
38
38
"github.com/cortexproject/cortex/pkg/util/validation"
39
39
)
40
40
@@ -140,7 +140,7 @@ var (
140
140
for i , point := range series .Histograms {
141
141
require .Equal (t , ts , point .T , strconv .Itoa (i ))
142
142
// Convert expected value to float histogram.
143
- expectedH := histogram_util . GenerateTestFloatHistogram (int (ts - 10 ))
143
+ expectedH := tsdbutil . GenerateTestGaugeFloatHistogram (int (ts ))
144
144
require .Equal (t , expectedH , point .H , strconv .Itoa (i ))
145
145
ts += int64 (q .step / time .Millisecond )
146
146
}
@@ -202,7 +202,7 @@ var (
202
202
for i , point := range series .Histograms {
203
203
require .Equal (t , ts , point .T , strconv .Itoa (i ))
204
204
// Convert expected value to float histogram.
205
- expectedH := histogram_util . GenerateTestFloatHistogram (int (ts - 10 ))
205
+ expectedH := tsdbutil . GenerateTestGaugeFloatHistogram (int (ts ))
206
206
require .Equal (t , expectedH , point .H , strconv .Itoa (i ))
207
207
ts += int64 (q .step / time .Millisecond )
208
208
}
@@ -222,7 +222,7 @@ var (
222
222
from , through := time .Unix (0 , 0 ), end .Time ()
223
223
require .Equal (t , q .samples (from , through , q .step ), len (series .Floats ))
224
224
for i , point := range series .Floats {
225
- expectedFH := histogram_util .GenerateTestFloatHistogram (int (ts - 10 ))
225
+ expectedFH := tsdbutil .GenerateTestFloatHistogram (int (ts ))
226
226
require .Equal (t , ts , point .T , strconv .Itoa (i ))
227
227
require .Equal (t , expectedFH .Sum , point .F , strconv .Itoa (i ))
228
228
ts += int64 (q .step / time .Millisecond )
@@ -243,7 +243,7 @@ var (
243
243
from , through := time .Unix (0 , 0 ), end .Time ()
244
244
require .Equal (t , q .samples (from , through , q .step ), len (series .Floats ))
245
245
for i , point := range series .Floats {
246
- expectedFH := histogram_util .GenerateTestFloatHistogram (int (ts - 10 ))
246
+ expectedFH := tsdbutil .GenerateTestFloatHistogram (int (ts ))
247
247
require .Equal (t , ts , point .T , strconv .Itoa (i ))
248
248
require .Equal (t , expectedFH .Count , point .F , strconv .Itoa (i ))
249
249
ts += int64 (q .step / time .Millisecond )
0 commit comments