How to calculate proxy latency when sending an HTTP request?

As you all know we can easily get duration details of an HTTP request by using ClientTrace. Like DNS time, TTFB, etc. But what if I use a proxy server while sending the request? As far as I know, ClientTrace does not have a hook for calculating the proxy server latency. Is there any other way to eliminate proxy server latency from the total request duration?

What I want to achieve;

Life cycle without proxy;

Client --- request_duration --->  Server
Client <-- response_duration ---  Server 

Life cycle with a proxy;

Client --- request_proxy_latency  ---> Proxy --- request_duration --->  Server
Client <-- response_proxy_latency ---- Proxy <-- response_duration ---  Server 

In both cases above I want to calculate only request_duration + response_duration.

I think you could just calcute the time on the client end.
For example, Pseudocode might look like this

start:=time.Now()
request.get();
end:=time.Now();

so the (end-start) will contain request_duration+response_duration

Looks like there is no way to extract the latency of the proxy.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.