]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: distinguish task endTimestamp and lastTimestamp
authorHana Kim <hakim@google.com>
Tue, 24 Apr 2018 19:37:42 +0000 (15:37 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Tue, 24 Apr 2018 21:49:40 +0000 (21:49 +0000)
commit011f6c5fa03bdcd433315c60b94f2327beec22fc
tree485cb66ae22fa593f2a86592b681b26570f6f2ef
parentd4e936cfd622de322dc93f69144c68bb4c133e21
cmd/trace: distinguish task endTimestamp and lastTimestamp

A task may have other user annotation events after the task ends.
So far, task.lastTimestamp returned the task end event if the
event available. This change introduces task.endTimestamp for that
and makes task.lastTimestamp returns the "last" seen event's timestamp
if the task is ended.

If the task is not ended, both returns the last timestamp of the entire
trace assuming the task is still active.

This fixes the task-oriented trace view mode not to drop user
annotation instances when they appear outside a task's lifespan.
Adds a test.

Change-Id: Iba1062914f224edd521b9ee55c6cd5e180e55359
Reviewed-on: https://go-review.googlesource.com/109175
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/trace/annotations.go
src/cmd/trace/trace.go
src/cmd/trace/trace_test.go