Forum Discussion
Simon_Blakely
Aug 10, 2020Employee
You could capture a timestamp from CLIENT_ACCEPTED, and then record the time for HTTP_REQUEST, and present that.
You would effectively be measuring the RTT of an ACK back to the client, and then the Browser sending the first request.
Something like:
when CLIENT_ACCEPTED {
set conntime [clock milliseconds]
}
when HTTP_REQUEST {
set reqtime [clock milliseconds]
set client_latency (reqtime - conntime)
HTTP::respond 200 content { \
<html> \
... \
time to respond is $client_latency \
.... \
</html> }
}
when HTTP_RESPONSE {
set resptime [clock milliseconds]
set server_latency (resptime - reqtime)
}
when HTTP_RESPONSE_RELEASE {
# reset conntime to track client latency
set conntime [clock milliseconds]
}