(ss []*tempopb.TimeSeries)
| 379 | } |
| 380 | |
| 381 | func (b *BaselineAggregator) Combine(ss []*tempopb.TimeSeries) { |
| 382 | for _, s := range ss { |
| 383 | var metaType string |
| 384 | var err string |
| 385 | var a string |
| 386 | var v Static |
| 387 | |
| 388 | // Scan all labels |
| 389 | for _, l := range s.Labels { |
| 390 | switch l.Key { |
| 391 | case internalLabelMetaType: |
| 392 | metaType = l.Value.GetStringValue() |
| 393 | case internalLabelError: |
| 394 | err = l.Value.GetStringValue() |
| 395 | default: |
| 396 | a = l.Key |
| 397 | v = StaticFromAnyValue(l.Value) |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | // Check for errors on this attribute |
| 402 | if err != "" { |
| 403 | if err == internalErrorTooManyValues { |
| 404 | // A sub-job reached max values for this attribute. |
| 405 | // Record the error |
| 406 | b.maxed[a] = struct{}{} |
| 407 | } |
| 408 | // Skip remaining processing regardless of error type |
| 409 | continue |
| 410 | } |
| 411 | |
| 412 | // Merge this time series into the destination buffer |
| 413 | // based on meta type |
| 414 | var dest map[string]map[StaticMapKey]staticWithTimeSeries |
| 415 | switch metaType { |
| 416 | case internalMetaTypeBaseline: |
| 417 | dest = b.baseline |
| 418 | case internalMetaTypeSelection: |
| 419 | dest = b.selection |
| 420 | case internalMetaTypeBaselineTotal: |
| 421 | dest = b.baselineTotals |
| 422 | case internalMetaTypeSelectionTotal: |
| 423 | dest = b.selectionTotals |
| 424 | default: |
| 425 | // Unknown type, ignore |
| 426 | continue |
| 427 | } |
| 428 | |
| 429 | attr, ok := dest[a] |
| 430 | if !ok { |
| 431 | attr = make(map[StaticMapKey]staticWithTimeSeries) |
| 432 | dest[a] = attr |
| 433 | } |
| 434 | |
| 435 | vk := v.MapKey() |
| 436 | ts, ok := attr[vk] |
| 437 | if !ok { |
| 438 | ts = staticWithTimeSeries{val: v, series: TimeSeries{Values: make([]float64, b.intervalMapper.IntervalCount())}} |
nothing calls this directly
no test coverage detected