Skip to content

Commit

Permalink
Move MockBackend numSpansReceived addition after ConsumeTraces
Browse files Browse the repository at this point in the history
Signed-off-by: James Ryans <james.ryans2012@gmail.com>
  • Loading branch information
james-ryans committed Jan 14, 2024
1 parent 6a61430 commit 43dc5f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions testbed/testbed/mock_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ func (tc *MockTraceConsumer) ConsumeTraces(_ context.Context, td ptrace.Traces)
return err
}

tc.numSpansReceived.Add(uint64(td.SpanCount()))

rs := td.ResourceSpans()
for i := 0; i < rs.Len(); i++ {
ils := rs.At(i).ScopeSpans()
Expand Down Expand Up @@ -226,6 +224,7 @@ func (tc *MockTraceConsumer) ConsumeTraces(_ context.Context, td ptrace.Traces)
}

tc.backend.ConsumeTrace(td)
tc.numSpansReceived.Add(uint64(td.SpanCount()))

return nil
}
Expand Down

0 comments on commit 43dc5f4

Please sign in to comment.