Request Start Time: | [clock format [lindex $property(start) 0] -format "%Y-%m-%d %H:%M:%S"]\n"
+
+
+ Request Start Time: | [clock format [lindex $property(start) 0] \
+ -format "%Y-%m-%d %H:%M:%S"]
+ }]
} else {
set expired_p 1
- append body "The information for this request is gone - either the server has been restarted, or
-the request is more than [parameter::get -parameter DeveloperSupportLifetime -default 900] seconds old.
-[ad_admin_footer]"
+ append body [subst {
+ The information for this request is gone - either the server has been restarted, or
+ the request is more than [parameter::get -parameter DeveloperSupportLifetime -default 900] seconds old.
+ }]
return
}
if { [info exists property(conn)] } {
- array set conn $property(conn)
foreach { key name } {
end {Request Completion Time}
@@ -58,62 +60,60 @@
validated {Session Validation}
error {Error}
} {
- if { [info exists conn($key)] } {
+ if { [dict exists $property(conn) $key] } {
+ set raw [dict get $property(conn) $key]
switch $key {
error {
- set value "[ns_quotehtml $conn($key)] "
+ set value "[ns_quotehtml $raw] "
}
endclicks {
- set value "[format "%.f" [expr { ($conn(endclicks) - $conn(startclicks)) }]] ms"
+ set value [format "%.f ms" [expr { $raw/1000.0 - [dict get $property(conn) startclicks] }]]
}
end {
- set value [clock format $conn($key) -format "%Y-%m-%d %H:%M:%S" ]
+ set value [clock format $raw -format "%Y-%m-%d %H:%M:%S"]
}
user_id {
- if { [db_0or1row user_info "
+ if { [db_0or1row user_info {
select first_names, last_name, email
from users
- where user_id = $conn(user_id)
- "] } {
- set value "
-$conn(user_id):
-$first_names $last_name (mailto:$email)
-"
+ where user_id = :raw
+ }] } {
+ set value [subst {
+ $raw:
+ $first_names $last_name (mailto:$email)
+ }]
} else {
- set value $conn(user_id)
+ set value $raw
}
}
default {
- set value [ns_quotehtml $conn($key)]
+ set value [ns_quotehtml $raw]
}
}
- append body " |
---|
$name: | [ad_decode $value "" "(empty)" $value] | \n"
+ append body [subst {
+ $name: | [ad_decode $value "" "(empty)" $value] |
+ }]
}
}
}
append body " "
if { [info exists property(rp)] } {
- append body "
-Request Processor
-
-"
+ append body [subst {
+ Request Processor
+
+ }]
foreach rp $property(rp) {
- set kind [lindex $rp 0]
- set info [lindex $rp 1]
- set startclicks [lindex $rp 2]
- set endclicks [lindex $rp 3]
- set action [lindex $rp 4]
- set error [lindex $rp 5]
+ lassign $rp kind info startclicks endclicks action error
- set duration "[format "%.1f" [expr { ($endclicks - $startclicks) }]] ms"
-
if { $kind eq "debug" && !$rp_show_debug_p } {
continue
}
+ set duration [format "%.1f ms" [expr { $endclicks - $startclicks }]]
+
if { [info exists conn(startclicks)] } {
append body "- [format "%+06.1f" [expr { ($startclicks - $conn(startclicks)) }]] ms: "
} else {
@@ -122,21 +122,14 @@
switch $kind {
transformation {
- set proc [lindex $info 0]
- set from [lindex $info 1]
- set to [lindex $info 2]
-# unlist $info proc from to
+ lassign $info proc from to
if { $to eq "" } {
set to "?"
}
append body "Applied transformation from $from -> $to - $duration\n"
}
filter {
- set kind [lindex $info 1]
- set method [lindex $info 2]
- set path [lindex $info 3]
- set proc [lindex $info 4]
- set args [lindex $info 5]
+ lassign $info . kind method path proc args
append body "Applied $kind filter: $proc [ns_quotehtml $args] (for $method $path) - $duration\n"
if {$action eq "error"} {
@@ -154,8 +147,7 @@
}
}
serve_file {
- set file [lindex $info 0]
- set handler [lindex $info 1]
+ lassign $info file handler
append body "Served file $file with $handler - $duration\n"
if {$action eq "error"} {
append body "
- returned error:
[ns_quotehtml $error] \n"
|
---|