(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestNaiveQueryRangeCombine(t *testing.T) { |
| 179 | tests := []struct { |
| 180 | name string |
| 181 | rNew *tempopb.QueryRangeResponse |
| 182 | rInto *tempopb.QueryRangeResponse |
| 183 | expected *tempopb.QueryRangeResponse |
| 184 | }{ |
| 185 | { |
| 186 | name: "combine series with different labels", |
| 187 | rNew: &tempopb.QueryRangeResponse{ |
| 188 | Series: []*tempopb.TimeSeries{ |
| 189 | { |
| 190 | Labels: []v1.KeyValue{ |
| 191 | {Key: "foo", Value: &v1.AnyValue{Value: &v1.AnyValue_StringValue{StringValue: "bar"}}}, |
| 192 | }, |
| 193 | Samples: []tempopb.Sample{{TimestampMs: 1000, Value: 1.0}}, |
| 194 | }, |
| 195 | }, |
| 196 | Metrics: &tempopb.SearchMetrics{ |
| 197 | InspectedBytes: 100, |
| 198 | CompletedJobs: 1, |
| 199 | InspectedTraces: 10, |
| 200 | InspectedSpans: 50, |
| 201 | }, |
| 202 | }, |
| 203 | rInto: &tempopb.QueryRangeResponse{ |
| 204 | Series: []*tempopb.TimeSeries{ |
| 205 | { |
| 206 | Labels: []v1.KeyValue{ |
| 207 | {Key: "baz", Value: &v1.AnyValue{Value: &v1.AnyValue_StringValue{StringValue: "qux"}}}, |
| 208 | }, |
| 209 | Samples: []tempopb.Sample{{TimestampMs: 2000, Value: 2.0}}, |
| 210 | }, |
| 211 | }, |
| 212 | Metrics: &tempopb.SearchMetrics{ |
| 213 | InspectedBytes: 50, |
| 214 | CompletedJobs: 1, |
| 215 | InspectedTraces: 5, |
| 216 | InspectedSpans: 25, |
| 217 | }, |
| 218 | }, |
| 219 | expected: &tempopb.QueryRangeResponse{ |
| 220 | Series: []*tempopb.TimeSeries{ |
| 221 | { |
| 222 | Labels: []v1.KeyValue{ |
| 223 | {Key: "baz", Value: &v1.AnyValue{Value: &v1.AnyValue_StringValue{StringValue: "qux"}}}, |
| 224 | }, |
| 225 | Samples: []tempopb.Sample{{TimestampMs: 2000, Value: 2.0}}, |
| 226 | }, |
| 227 | { |
| 228 | Labels: []v1.KeyValue{ |
| 229 | {Key: "foo", Value: &v1.AnyValue{Value: &v1.AnyValue_StringValue{StringValue: "bar"}}}, |
| 230 | }, |
| 231 | Samples: []tempopb.Sample{{TimestampMs: 1000, Value: 1.0}}, |
| 232 | }, |
| 233 | }, |
| 234 | Metrics: &tempopb.SearchMetrics{ |
| 235 | InspectedBytes: 150, |
nothing calls this directly
no test coverage detected