String return the details of trace information.
()
| 55 | |
| 56 | // String return the details of trace information. |
| 57 | func (t TraceInfo) String() string { |
| 58 | if t.RemoteAddr == nil { |
| 59 | return "trace is not enabled" |
| 60 | } |
| 61 | if t.IsConnReused { |
| 62 | return fmt.Sprintf(traceReusedFmt, t.TotalTime, t.FirstResponseTime, t.ResponseTime, t.RemoteAddr, t.LocalAddr) |
| 63 | } |
| 64 | return fmt.Sprintf(traceFmt, t.TotalTime, t.DNSLookupTime, t.TCPConnectTime, t.TLSHandshakeTime, t.FirstResponseTime, t.ResponseTime, t.RemoteAddr, t.LocalAddr) |
| 65 | } |
| 66 | |
| 67 | // TraceInfo represents the trace information. |
| 68 | type TraceInfo struct { |
no outgoing calls