• Hana Kim's avatar
    cmd/trace: change span id computation for trace view use · 1d8fc211
    Hana Kim authored
    golang.org/cl/102697 attempted to fix the span presentation by utilizing
    the position of the span in the span slices of a task. But it is
    not complete either.
    
    First, id=0 is omitted in json encoding and the trace viewer silently
    drops entries with the missing id field, so we must avoid zero-value id.
    Second, it is possible that a goroutine handles multiple tasks. Then,
    id collisions will happen.
    
    This takes a simpler approach - have a counter that increments for every
    emitSpan call, and use the value as the id value.
    
    Change-Id: Idaa9505634acf6d327c6f00af32d8260955b85e1
    Reviewed-on: https://go-review.googlesource.com/106755Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
    Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    1d8fc211
Name
Last commit
Last update
..
annotations.go Loading commit data...
annotations_test.go Loading commit data...
doc.go Loading commit data...
goroutines.go Loading commit data...
main.go Loading commit data...
pprof.go Loading commit data...
trace.go Loading commit data...
trace_test.go Loading commit data...
trace_unix_test.go Loading commit data...