Forum Discussion
Stanislas_Piro2
Mar 21, 2017Cumulonimbus
Hi,
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}]"
}
}
}