(span Span)
| 111 | } |
| 112 | |
| 113 | func (m *MetricsCompare) observe(span Span) { |
| 114 | // For performance, MetricsCompare doesn't use the Range/StepAggregator abstractions. |
| 115 | // This lets us: |
| 116 | // * Include the same attribute value in multiple series. This doesn't fit within |
| 117 | // the existing by() grouping or even the potential byeach() (which was in this branch and then deleted) |
| 118 | // * Avoid reading the span start time twice, once for the selection window filter, and |
| 119 | // then again instead of StepAggregator. |
| 120 | // TODO - It would be nice to use those abstractions, area for future improvement |
| 121 | st := span.StartTimeUnixNanos() |
| 122 | m.interval = m.intervalMapper.Interval(st) |
| 123 | |
| 124 | // Determine if this span is inside the selection |
| 125 | // and choose destination buffers |
| 126 | if m.isSelection(span, st).Equals(&StaticTrue) { |
| 127 | m.dest = m.selections |
| 128 | m.destTotals = m.selectionTotals |
| 129 | } else { |
| 130 | m.dest = m.baselines |
| 131 | m.destTotals = m.baselineTotals |
| 132 | } |
| 133 | |
| 134 | // Increment values for all attributes of this span |
| 135 | span.AllAttributesFunc(m.attrCallback) |
| 136 | } |
| 137 | |
| 138 | // processAttribute is the callback for span.AllAttributesFunc. |
| 139 | // But it's structured in a certain way to avoid allocating closures and escaping |
nothing calls this directly
no test coverage detected