Documentation
¶
Index ¶
Constants ¶
View Source
const ( WatchStart = watchType(iota) WatchDone WatchAll )
Variables ¶
This section is empty.
Functions ¶
func Recycle ¶ added in v0.1.1
func Recycle(tc *TraceContext)
Types ¶
type TraceContext ¶
type TraceContext struct { DNS TimeSpan DNSName string // DNSName is populated after "dns_start" event DNSErr error // DNSErr is populated after "dns_done" event TLSHandshake TimeSpan TLSConnState *tls.ConnectionState // TLSConnState is populated after "tls_handshake_done" event TLSErr error // TLSErr is populated after "tls_handshake_done" event Connect TimeSpan ConnectAddress string ConnectErr error Total time.Duration // from start to PutIdleConn FirstByte time.Duration // from start to GotFirstResponseByte OnEvent func(ctx *TraceContext, event string) // contains filtered or unexported fields }
func WithTraceContext ¶
func WithTraceContext( ctx context.Context, hook func(ctx *TraceContext, event string), watch watchType, ) (context.Context, *TraceContext)
WithTraceContext should be called before sending the request on the request context the returning context should be set on the request. keep hold of the returning TraceContext and call Recycle on it after all tracing job is done (e.g. finished sending the metrics)
func (*TraceContext) Init ¶
func (tc *TraceContext) Init()
func (*TraceContext) Reset ¶
func (tc *TraceContext) Reset()
func (*TraceContext) Stop ¶
func (tc *TraceContext) Stop()
Click to show internal directories.
Click to hide internal directories.