Forum Discussion
oscarnet_69487
Nimbostratus
Mar 21, 2017how to check uri clock time select pool
Hi how can i use uri clock to select pool ? my irule Code
when RULE_INIT {
set client_req_start_time [clock clicks -milliseconds]
}
when HTTP_REQUEST {
set http_request_time1 {[HTTP::uri] ends_...
Stanislas_Piro2
Cumulonimbus
Mar 21, 2017Hi,
I think you want to know the time between request and response:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
set client_req_start_time [clock clicks -milliseconds]
switch -glob -- [HTTP::path] {
"*.jpg" {
set filetype "jpg"
pool pool_jpgA
}
"*.png" {
set filetype "png"
pool pool_jpgA
}
"default" {
set filetype "default"
pool $default_pool
}
}
}
when HTTP_RESPONSE {
switch -- $filetype {
"jpg" {
log local0. "jpg file - clock time : [expr {[clock clicks -milliseconds] - $client_req_start_time}]"
}
"png" {
log local0. "png file - clock time : [expr {[clock clicks -milliseconds] - $client_req_start_time}]"
}
default {
log local0. "gif file - clock time : [expr {[clock clicks -milliseconds] - $client_req_start_time}]"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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