On reused connections do not use connStart because GetConn is never called. Fixes issue #38 (#79)

This commit is contained in:
mdakin
2017-12-26 20:57:38 +01:00
committed by GitHub
parent c2c7035fae
commit b633e22873

View File

@@ -149,7 +149,9 @@ func (b *Work) makeRequest(c *http.Client) {
connStart = time.Now()
},
GotConn: func(connInfo httptrace.GotConnInfo) {
connDuration = time.Now().Sub(connStart)
if !connInfo.Reused {
connDuration = time.Now().Sub(connStart)
}
reqStart = time.Now()
},
WroteRequest: func(w httptrace.WroteRequestInfo) {