Skip to content

Commit d782cad

Browse files
authored
Add start time on perf trace because it seems some steps haven't been recorded. (#35282)
The new trace log looks like ``` http start=2025-08-14 15:03:04 duration=0.6978s http.route=/ http.func start=2025-08-14 15:03:04 duration=0.6978s func=common.ForwardedHeadersHandler.ForwardedHeaders http.func start=2025-08-14 15:03:04 duration=0.6978s func=routing.(*requestRecordsManager).handler-fm http.func start=2025-08-14 15:03:04 duration=0.6978s func=gzhttp.NewWrapper http.func start=2025-08-14 15:03:04 duration=0.6975s func=session.Sessioner http.func start=2025-08-14 15:03:04 duration=0.6973s func=context.Contexter ```
1 parent 2872984 commit d782cad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/gtprof/trace_builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (t *traceBuiltinSpan) toString(out *strings.Builder, indent int) {
4040
if t.ts.endTime.IsZero() {
4141
out.WriteString(" duration: (not ended)")
4242
} else {
43-
fmt.Fprintf(out, " duration=%.4fs", t.ts.endTime.Sub(t.ts.startTime).Seconds())
43+
fmt.Fprintf(out, " start=%s duration=%.4fs", t.ts.startTime.Format("2006-01-02 15:04:05"), t.ts.endTime.Sub(t.ts.startTime).Seconds())
4444
}
4545
for _, a := range t.ts.attributes {
4646
out.WriteString(" ")

0 commit comments

Comments
 (0)