1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-28 20:56:03 +00:00

nettrace: Add a new tracing library

This commit introduces a new tracing library, that replaces
golang.org/x/net/trace, and supports (amongts other thing) nested
traces.

This is a minimal change, future patches will make use of the new
functionality.
This commit is contained in:
Alberto Bertogli
2022-03-07 01:13:34 +00:00
parent 3ebe5c5173
commit 9c6661eca2
18 changed files with 2276 additions and 54 deletions

View File

@@ -0,0 +1,35 @@
<tr class="title">
<td class="when">{{.Start.Format "2006-01-02 15:04:05.000000"}}</td>
<td class="duration">{{.Duration | roundSeconds}}</td>
<td><a href="?trace={{.ID}}">{{.Title}}</a>
{{if .Parent}}(parent: <a href="?trace={{.Parent.ID}}&ref={{.ID}}">
{{.Parent.Family}} - {{.Parent.Title}}</a>)
{{end}}
</td>
<tr>
{{$prev := .Start}}
{{range .Events}}
<tr>
<td class="when">{{.When.Format "15:04:05.000000"}}</td>
<td class="duration">{{(.When.Sub $prev) | stripZeros}}</td>
<td class="msg">
{{- if .Type.IsLog -}}
{{.Msg}}
{{- else if .Type.IsChild -}}
new child <a href="?trace={{.Ref.ID}}&ref={{$.ID}}">{{.Ref.Family}} {{.Ref.Title}}</a>
{{- else if .Type.IsLink -}}
<a href="?trace={{.Ref.ID}}&ref={{$.ID}}">{{.Msg}}</a>
{{- else if .Type.IsDrop -}}
<i>[ events dropped ]</i>
{{- else -}}
<i>[ unknown event type ]</i>
{{- end -}}
</td>
</tr>
{{$prev = .When}}
{{end}}
<tr>
<td>&nbsp;</td>
</tr>