(in []*tempopb.TimeSeries)
| 1626 | } |
| 1627 | |
| 1628 | func (b *SimpleAggregator) Combine(in []*tempopb.TimeSeries) { |
| 1629 | nan := math.Float64frombits(normalNaN) |
| 1630 | |
| 1631 | for _, ts := range in { |
| 1632 | // Convert proto labels to traceql labels |
| 1633 | labels, _ := convertProtoLabelsToTraceQL(ts.Labels, false) |
| 1634 | key := labels.MapKey() |
| 1635 | |
| 1636 | existing, ok := b.ss[key] |
| 1637 | if !ok { |
| 1638 | |
| 1639 | existing = TimeSeries{ |
| 1640 | Labels: labels, |
| 1641 | Values: make([]float64, b.intervalMapper.IntervalCount()), |
| 1642 | Exemplars: make([]Exemplar, 0, len(ts.Exemplars)), |
| 1643 | } |
| 1644 | if b.initWithNaN { |
| 1645 | for i := range existing.Values { |
| 1646 | existing.Values[i] = nan |
| 1647 | } |
| 1648 | } |
| 1649 | |
| 1650 | b.ss[key] = existing |
| 1651 | } |
| 1652 | |
| 1653 | for _, sample := range ts.Samples { |
| 1654 | j := b.intervalMapper.IntervalMs(sample.TimestampMs) |
| 1655 | if j >= 0 && j < len(existing.Values) { |
| 1656 | existing.Values[j] = b.aggregationFunc(existing.Values[j], sample.Value) |
| 1657 | } |
| 1658 | } |
| 1659 | |
| 1660 | b.aggregateExemplars(ts, &existing) |
| 1661 | |
| 1662 | b.ss[key] = existing |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | func (b *SimpleAggregator) aggregateExemplars(ts *tempopb.TimeSeries, existing *TimeSeries) { |
| 1667 | for _, exemplar := range ts.Exemplars { |
nothing calls this directly
no test coverage detected