Hi,
I’m trying to extend the examples in this post (Click here)
The goal is to log different deltas for request and response times. Ideally, I’d like to be able to measure four data points and compare the deltas:
1) HTTP request initiated by client to TMM (HTTP_REQUEST)
2) HTTP request sent from TMM to node (HTTP_REQUEST_SEND)
3) HTTP response received by TMM from node (HTTP_RESPONSE_DATA)
4) HTTP response sent from TMM to client (event doesn’t exist?)
Using the below rule, I’ve been able to get a delta from 1) to 3). I could also use the HTTP_REQUEST_DATA event to find out how long it takes for TMM to receive the full request data.
However, I’d like to know if there is a method for getting the current time when TMM sends the HTTP response back to the client. If there isn’t a current method, could you consider adding a new event for HTTP_RESPONSE_SEND?
If the client uses a single TCP connection for a single HTTP request, I could look at the CLIENT_CLOSED event. However most clients re-use TCP connections for multiple HTTP requests, so this doesn’t suffice.
Here’s the current version of the rule I’m using to log the delta between the request being received (1) and the response data being received:
when RULE_INIT {
set tcp counter
set tcp_count 0
}
when CLIENT_ACCEPTED {
incr ::tcp_count
set http_count 0
}
when HTTP_REQUEST {
incr http_count
set http_request_start_time [clock clicks -milliseconds]
set uri [HTTP::uri]
start collecting HTTP request data
HTTP::collect 15
}
when HTTP_RESPONSE {
get response content length
if { [HTTP::header exists "Content-Length"] }{
set content_length [HTTP::header value "Content-Length"]
}
else {
set content_length 0
}
start collecting HTTP response data
HTTP::collect 15
}
when HTTP_RESPONSE_DATA {
set http_response_data_start_time [clock clicks -milliseconds]
set delta_bigip [expr ( [expr abs ($http_request_start_time)] - [expr abs ($http_response_data_start_time)] )]
log local0. ",$delta_bigip,$uri,$content_length, - fields ,delta,uri,content length,"
}
Thanks,
Aaron