func NewHTTPTrace(ctx context.Context) *HTTPTrace {
	t := &HTTPTrace{
		Start: time.Now(),
	}

	trace := &httptrace.ClientTrace{
		GetConn:              t.getConn,
		GotConn:              t.gotConn,
		PutIdleConn:          t.putIdleConn,
		GotFirstResponseByte: t.gotFirstResponseByte,
		Got100Continue:       t.got100Continue,
		DNSStart:             t.dnsStart,
		DNSDone:              t.dnsDone,
		ConnectStart:         t.connectStart,
		ConnectDone:          t.connectDone,
		TLSHandshakeStart:    t.tlsHandshakeStart,
		TLSHandshakeDone:     t.tlsHandshakeDone,
		WroteHeaders:         t.wroteHeaders,
		Wait100Continue:      t.wait100Continue,
		WroteRequest:         t.wroteRequest,
	}

	t.Context = httptrace.WithClientTrace(ctx, trace)

	return t
}
// NewHTTPTrace returns a initialized HTTPTrace for an
// httptrace.ClientTrace, based on the context passed.
NewHTTPTrace returns a initialized HTTPTrace for an
httptrace.ClientTrace, based on the context passed.
// NewHTTPTrace returns a initialized HTTPTrace for an // httptrace . ClientTrace based on the context passed .
func NewHTTPTrace(ctx context.Context) *HTTPTrace {
	t := &HTTPTrace{
		Start: time.Now(),
	}
	trace := &httptrace.ClientTrace{
		GetConn:              t.getConn,
		GotConn:              t.gotConn,
		PutIdleConn:          t.putIdleConn,
		GotFirstResponseByte: t.gotFirstResponseByte,
		Got100Continue:       t.got100Continue,
		DNSStart:             t.dnsStart,
		DNSDone:              t.dnsDone,
		ConnectStart:         t.connectStart,
		ConnectDone:          t.connectDone,
		TLSHandshakeStart:    t.tlsHandshakeStart,
		TLSHandshakeDone:     t.tlsHandshakeDone,
		WroteHeaders:         t.wroteHeaders,
		Wait100Continue:      t.wait100Continue,
		WroteRequest:         t.wroteRequest,
	}
	t.Context = httptrace.WithClientTrace(ctx, trace)
	return t
}
func NewHTTPTrace ( ctx context . Context ) * HTTPTrace { t := & HTTPTrace { Start : time . Now ( ) , } trace := & httptrace . ClientTrace { GetConn : t . getConn , GotConn : t . gotConn , PutIdleConn : t . putIdleConn , GotFirstResponseByte : t . gotFirstResponseByte , Got100Continue : t . got100Continue , DNSStart : t . dnsStart , DNSDone : t . dnsDone , ConnectStart : t . connectStart , ConnectDone : t . connectDone , TLSHandshakeStart : t . tlsHandshakeStart , TLSHandshakeDone : t . tlsHandshakeDone , WroteHeaders : t . wroteHeaders , Wait100Continue : t . wait100Continue , WroteRequest : t . wroteRequest , } t . Context = httptrace . WithClientTrace ( ctx , trace ) return t }
NewHTTPTrace returns a initialized HTTPTrace for an
httptrace.ClientTrace, based on the context passed.
NewHTTPTrace returns a initialized HTTPTrace for an httptrace . ClientTrace based on the context passed .