Skip to content

Commit

Permalink
add a timestamp to trace events (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Jun 1, 2022
1 parent 5d31004 commit 6eb28aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion p2p/host/resource-manager/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const (
)

type traceEvt struct {
Time string
Type string

Scope string `json:",omitempty"`
Expand All @@ -70,13 +71,14 @@ type traceEvt struct {
FD int `json:",omitempty"`
}

func (t *trace) push(evt interface{}) {
func (t *trace) push(evt traceEvt) {
t.mx.Lock()
defer t.mx.Unlock()

if t.done {
return
}
evt.Time = time.Now().Format(time.RFC3339)

t.pend = append(t.pend, evt)
}
Expand Down

0 comments on commit 6eb28aa

Please sign in to comment.