Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 6254433

Browse files
authored
Merge pull request #1519 from grafana/fix-build
fix build.
2 parents 38028b3 + 367c1bc commit 6254433

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

mdata/aggregator_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ func TestAggregator(t *testing.T) {
7676
AggregationMethod: []conf.Method{conf.Avg, conf.Min, conf.Max, conf.Sum, conf.Lst},
7777
}
7878

79-
agg := NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(0), ret, aggs, false, 0)
79+
agg := NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(0), ret.String(), ret, aggs, false, 0)
8080
agg.Add(100, 123.4)
8181
agg.Add(110, 5)
8282
expected := []schema.Point{}
8383
compare("simple-min-unfinished", agg.minMetric, expected)
8484

85-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 0)
85+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 0)
8686
agg.Add(100, 123.4)
8787
agg.Add(110, 5)
8888
agg.Add(130, 130)
@@ -92,7 +92,7 @@ func TestAggregator(t *testing.T) {
9292
compare("simple-min-one-block", agg.minMetric, expected)
9393

9494
// points with a timestamp belonging to the previous aggregation are ignored
95-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 0)
95+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 0)
9696
agg.Add(100, 123.4)
9797
agg.Add(110, 5)
9898
agg.Add(130, 130)
@@ -103,7 +103,7 @@ func TestAggregator(t *testing.T) {
103103
compare("simple-min-ignore-back-in-time", agg.minMetric, expected)
104104

105105
// chunkspan is 120, ingestFrom = 140 means points before chunk starting at 240 are discarded
106-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 140)
106+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 140)
107107
agg.Add(100, 123.4)
108108
agg.Add(110, 5)
109109
// this point is not flushed to agg.minMetric because no point after it with a timestamp
@@ -113,7 +113,7 @@ func TestAggregator(t *testing.T) {
113113
compare("simple-min-ingest-from-all-before-next-chunk", agg.minMetric, expected)
114114

115115
// chunkspan is 120, ingestFrom = 115 means points before chunk starting at 120 are discarded
116-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 115)
116+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 115)
117117
agg.Add(100, 123.4)
118118
agg.Add(110, 5)
119119
// this point is not flushed to agg.minMetric for the same reason as in the previous test
@@ -124,7 +124,7 @@ func TestAggregator(t *testing.T) {
124124
compare("simple-min-ingest-from-one-in-next-chunk", agg.minMetric, expected)
125125

126126
// chunkspan is 120, ingestFrom = 120 means points before chunk starting at 120 are discarded
127-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 120)
127+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 120)
128128
agg.Add(100, 123.4)
129129
agg.Add(110, 5)
130130
// this point is not flushed to agg.minMetric for the same reason as in the previous test
@@ -142,7 +142,7 @@ func TestAggregator(t *testing.T) {
142142
// aggregated points: 120 180 240 300 360
143143
// chunks by t0 : 120 240 300 360
144144
// discarded chunk : xxxxxxxxxxxxxxxxxxxxx
145-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret, aggs, false, 170)
145+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(1), ret.String(), ret, aggs, false, 170)
146146
agg.Add(1, 1.1)
147147
agg.Add(119, 119)
148148
agg.Add(120, 120)
@@ -171,7 +171,7 @@ func TestAggregator(t *testing.T) {
171171
}
172172
compare("multi-sum-ingest-from-one-in-next-chunk", agg.sumMetric, expected)
173173

174-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(2), ret, aggs, false, 0)
174+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(2), ret.String(), ret, aggs, false, 0)
175175
agg.Add(100, 123.4)
176176
agg.Add(110, 5)
177177
agg.Add(120, 4)
@@ -180,7 +180,7 @@ func TestAggregator(t *testing.T) {
180180
}
181181
compare("simple-min-one-block-done-cause-last-point-just-right", agg.minMetric, expected)
182182

183-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(3), ret, aggs, false, 0)
183+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(3), ret.String(), ret, aggs, false, 0)
184184
agg.Add(100, 123.4)
185185
agg.Add(110, 5)
186186
agg.Add(150, 1.123)
@@ -191,7 +191,7 @@ func TestAggregator(t *testing.T) {
191191
}
192192
compare("simple-min-two-blocks-done-cause-last-point-just-right", agg.minMetric, expected)
193193

194-
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(4), ret, aggs, false, 0)
194+
agg = NewAggregator(mockstore, &cache.MockCache{}, test.GetAMKey(4), ret.String(), ret, aggs, false, 0)
195195
agg.Add(100, 123.4)
196196
agg.Add(110, 5)
197197
agg.Add(190, 2451.123)

0 commit comments

Comments
 (0)