getSeries gets the series for the current span. It will reuse the last series if possible.
()
| 780 | // getSeries gets the series for the current span. |
| 781 | // It will reuse the last series if possible. |
| 782 | func (g *GroupingAggregator[F, S]) getSeries() aggregatorWitValues[S] { |
| 783 | // Fast path |
| 784 | if g.lastSeries.agg != nil && g.lastBuf.fast == g.buf.fast { |
| 785 | return g.lastSeries |
| 786 | } |
| 787 | |
| 788 | s, ok := g.series[g.buf.fast] |
| 789 | if !ok { |
| 790 | s.agg = g.innerAgg() |
| 791 | s.vals = g.buf.vals |
| 792 | g.series[g.buf.fast] = s |
| 793 | } |
| 794 | |
| 795 | g.lastBuf = g.buf |
| 796 | g.lastSeries = s |
| 797 | return s |
| 798 | } |
| 799 | |
| 800 | // Observe the span by looking up its group-by attributes, mapping to the series, |
| 801 | // and passing to the inner aggregate. This is a critical hot path. |
no outgoing calls
no test coverage detected