proxy表指标:修改记录timestamp时间为转发开始时间

This commit is contained in:
Liujian
2022-12-22 15:53:48 +08:00
parent c7b564ec91
commit b93d293f44
26 changed files with 209 additions and 127 deletions

View File

@@ -135,10 +135,10 @@ func (ctx *HttpContext) SendTo(address string, timeout time.Duration) error {
request.URI().SetHost(targetHost)
}
now := time.Now()
beginTime := time.Now()
ctx.response.responseError = fasthttp_client.ProxyTimeout(address, request, &ctx.fastHttpRequestCtx.Response, timeout)
agent := newRequestAgent(&ctx.proxyRequest, host, scheme, time.Now().Sub(now))
agent := newRequestAgent(&ctx.proxyRequest, host, scheme, beginTime, time.Now())
agent.setStatusCode(ctx.fastHttpRequestCtx.Response.StatusCode())
agent.setResponseLength(ctx.fastHttpRequestCtx.Response.Header.ContentLength())