@@ -76,13 +76,13 @@ func TestAggregator(t *testing.T) {
76
76
AggregationMethod : []conf.Method {conf .Avg , conf .Min , conf .Max , conf .Sum , conf .Lst },
77
77
}
78
78
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 )
80
80
agg .Add (100 , 123.4 )
81
81
agg .Add (110 , 5 )
82
82
expected := []schema.Point {}
83
83
compare ("simple-min-unfinished" , agg .minMetric , expected )
84
84
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 )
86
86
agg .Add (100 , 123.4 )
87
87
agg .Add (110 , 5 )
88
88
agg .Add (130 , 130 )
@@ -92,7 +92,7 @@ func TestAggregator(t *testing.T) {
92
92
compare ("simple-min-one-block" , agg .minMetric , expected )
93
93
94
94
// 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 )
96
96
agg .Add (100 , 123.4 )
97
97
agg .Add (110 , 5 )
98
98
agg .Add (130 , 130 )
@@ -103,7 +103,7 @@ func TestAggregator(t *testing.T) {
103
103
compare ("simple-min-ignore-back-in-time" , agg .minMetric , expected )
104
104
105
105
// 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 )
107
107
agg .Add (100 , 123.4 )
108
108
agg .Add (110 , 5 )
109
109
// 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) {
113
113
compare ("simple-min-ingest-from-all-before-next-chunk" , agg .minMetric , expected )
114
114
115
115
// 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 )
117
117
agg .Add (100 , 123.4 )
118
118
agg .Add (110 , 5 )
119
119
// 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) {
124
124
compare ("simple-min-ingest-from-one-in-next-chunk" , agg .minMetric , expected )
125
125
126
126
// 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 )
128
128
agg .Add (100 , 123.4 )
129
129
agg .Add (110 , 5 )
130
130
// 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) {
142
142
// aggregated points: 120 180 240 300 360
143
143
// chunks by t0 : 120 240 300 360
144
144
// 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 )
146
146
agg .Add (1 , 1.1 )
147
147
agg .Add (119 , 119 )
148
148
agg .Add (120 , 120 )
@@ -171,7 +171,7 @@ func TestAggregator(t *testing.T) {
171
171
}
172
172
compare ("multi-sum-ingest-from-one-in-next-chunk" , agg .sumMetric , expected )
173
173
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 )
175
175
agg .Add (100 , 123.4 )
176
176
agg .Add (110 , 5 )
177
177
agg .Add (120 , 4 )
@@ -180,7 +180,7 @@ func TestAggregator(t *testing.T) {
180
180
}
181
181
compare ("simple-min-one-block-done-cause-last-point-just-right" , agg .minMetric , expected )
182
182
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 )
184
184
agg .Add (100 , 123.4 )
185
185
agg .Add (110 , 5 )
186
186
agg .Add (150 , 1.123 )
@@ -191,7 +191,7 @@ func TestAggregator(t *testing.T) {
191
191
}
192
192
compare ("simple-min-two-blocks-done-cause-last-point-just-right" , agg .minMetric , expected )
193
193
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 )
195
195
agg .Add (100 , 123.4 )
196
196
agg .Add (110 , 5 )
197
197
agg .Add (190 , 2451.123 )
0 commit comments