Forum Discussion
jiseruk_43901
Nimbostratus
Sep 26, 2013Irule for getting total response time, server response time and server connection time
Hi. I have an irule that calculates total response time, server response time and server connection time for each requests and logs the data with high speed logging. But sometimes the connection time...
jiseruk_43901
Nimbostratus
Oct 02, 2013Thanks!! It make sense what you said. So, I fixed the irule, putting "set connection_time 0" in the last part of the event HTTP_RESPONSE_RELEASE, so only when the SERVER_CONNECTED event happends, I calculate the connection_time, and that only happends once per connection, right?. This is the fixed irule:
when RULE_INIT {
set static::bigip [info hostname]
set static::facility <191>
set static::hsl_prefix "$static::facility|host=$static::bigip"
}
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool hsl_pool]
set tcp_start_time [clock clicks -milliseconds]
}
when HTTP_REQUEST {
set http_request_time [clock clicks -milliseconds]
}
when HTTP_REQUEST_SEND {
set http_request_send_time [clock clicks -milliseconds]
}
when LB_SELECTED {
set lb_selected_time [clock clicks -milliseconds]
set hsl_prefix "${static::hsl_prefix}|upstream=[LB::server addr]"
}
when SERVER_CONNECTED {
set connection_time [expr {[clock clicks -milliseconds] - $lb_selected_time}]
}
when HTTP_RESPONSE {
set upstream_time [expr {[clock clicks -milliseconds] - $http_request_send_time}]
}
when HTTP_RESPONSE_RELEASE {
HSL::send $hsl "$hsl_prefix|event=X_REQUEST|total_time [expr {[clock clicks -milliseconds] - $http_request_time}]|upstream_time $upstream_time|connection_time $connection_time|vserver_name [virtual name]\n"
set connection_time 0
}
Thanks!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects