@@ -48,10 +48,8 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData {
4848 var out []* SpanData
4949 s .mu .Lock ()
5050 defer s .mu .Unlock ()
51- for activeSpan := range s .active {
52- if s , ok := activeSpan .(* span ); ok {
53- out = append (out , s .makeSpanData ())
54- }
51+ for span := range s .active {
52+ out = append (out , span .makeSpanData ())
5553 }
5654 return out
5755}
@@ -187,7 +185,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t
187185// bucketed by latency.
188186type spanStore struct {
189187 mu sync.Mutex // protects everything below.
190- active map [Span ]struct {}
188+ active map [* Span ]struct {}
191189 errors map [int32 ]* bucket
192190 latency []bucket
193191 maxSpansPerErrorBucket int
@@ -196,7 +194,7 @@ type spanStore struct {
196194// newSpanStore creates a span store.
197195func newSpanStore (name string , latencyBucketSize int , errorBucketSize int ) * spanStore {
198196 s := & spanStore {
199- active : make (map [Span ]struct {}),
197+ active : make (map [* Span ]struct {}),
200198 latency : make ([]bucket , len (defaultLatencies )+ 1 ),
201199 maxSpansPerErrorBucket : errorBucketSize ,
202200 }
@@ -273,15 +271,15 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) {
273271}
274272
275273// add adds a span to the active bucket of the spanStore.
276- func (s * spanStore ) add (span Span ) {
274+ func (s * spanStore ) add (span * Span ) {
277275 s .mu .Lock ()
278276 s .active [span ] = struct {}{}
279277 s .mu .Unlock ()
280278}
281279
282280// finished removes a span from the active set, and adds a corresponding
283281// SpanData to a latency or error bucket.
284- func (s * spanStore ) finished (span Span , sd * SpanData ) {
282+ func (s * spanStore ) finished (span * Span , sd * SpanData ) {
285283 latency := sd .EndTime .Sub (sd .StartTime )
286284 if latency < 0 {
287285 latency = 0
0 commit comments