diff --git a/app/webclientimpl.go b/app/webclientimpl.go index 9169a4a..1a5a2c0 100644 --- a/app/webclientimpl.go +++ b/app/webclientimpl.go @@ -286,7 +286,7 @@ func (webClient *webClientImpl) DoMeasure(followRedirect bool) *HTTPMeasure { remoteAddr = info.Conn.RemoteAddr().String() timerRegistry.Get(stats.Conn).Stop() timerRegistry.Get(stats.Req).Start() - timerRegistry.Get(stats.ReqAndWait).Start() + timerRegistry.Get(stats.ReqAndWait).StartForce() reused = info.Reused }, @@ -330,6 +330,7 @@ func (webClient *webClientImpl) DoMeasure(followRedirect bool) *HTTPMeasure { webClient.prepareReq(req) timerRegistry.Get(stats.Total).Start() + timerRegistry.Get(stats.ReqAndWait).Start() // for HTTP/3 with keep-alive res, err := webClient.httpClient.Do(req) diff --git a/stats/timer.go b/stats/timer.go index 8694d94..44dded7 100644 --- a/stats/timer.go +++ b/stats/timer.go @@ -46,6 +46,10 @@ func (t *Timer) Start() { } } +func (t *Timer) StartForce() { + t.startTime = time.Now() +} + func (t *Timer) Stop() { ts := time.Now() if ts.After(t.stopTime) {