Request Start Time: |
- [clock format [lindex $property(start) 0] -format "%Y-%m-%d %H:%M:%S"]
+
+
+ Request Start Time: |
+ [clock format [lindex $property(start) 0] -format "%Y-%m-%d %H:%M:%S"]
}]
} else {
set expired_p 1
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.
+ 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
}
@@ -50,163 +50,163 @@
foreach { key name } {
end {Request Completion Time}
- endclicks {Request Duration}
+ endclicks {Request Duration}
peeraddr IP
- method Method
- url URL
- query Query
+ method Method
+ url URL
+ query Query
user_id {User ID}
session_id {Session ID}
browser_id {Browser ID}
validated {Session Validation}
- error {Error}
+ error {Error}
} {
- if { [dict exists $property(conn) $key] } {
- set raw [dict get $property(conn) $key]
- switch $key {
- error {
- set value "[ns_quotehtml $raw] "
- }
- endclicks {
- set value [format "%.f ms" [expr { ($raw - [dict get $property(conn) startclicks]) / 1000.0 }]]
- }
- end {
- set value [clock format $raw -format "%Y-%m-%d %H:%M:%S"]
- }
- user_id {
- if { [db_0or1row user_info {
+ if { [dict exists $property(conn) $key] } {
+ set raw [dict get $property(conn) $key]
+ switch $key {
+ error {
+ set value "[ns_quotehtml $raw] "
+ }
+ endclicks {
+ set value [format "%.f ms" [expr { ($raw - [dict get $property(conn) startclicks]) / 1000.0 }]]
+ }
+ end {
+ set value [clock format $raw -format "%Y-%m-%d %H:%M:%S"]
+ }
+ user_id {
+ if { [db_0or1row user_info {
select first_names, last_name, email
from users
where user_id = :raw
- }] } {
- set value [subst {
- $raw:
- $first_names $last_name (mailto:$email)
- }]
- } else {
- set value $raw
- }
- }
- default {
- set value [ns_quotehtml $raw]
- }
- }
+ }] } {
+ set value [subst {
+ $raw:
+ $first_names $last_name (mailto:$email)
+ }]
+ } else {
+ set value $raw
+ }
+ }
+ default {
+ set value [ns_quotehtml $raw]
+ }
+ }
- append body [subst {
- |
---|
$name: |
- [expr {$value eq "" ? "(empty)" : $value}] |
-
- }]
- }
+ append body [subst {
+ $name: |
+ [expr {$value eq "" ? "(empty)" : $value}] |
+
+ }]
+ }
}
}
append body " "
if { [info exists property(rp)] } {
append body [subst {
- Request Processor
-
+ Request Processor
+ \n"
}
if { [info exists property(comment)] } {
append body "Comments\n"
foreach comment $property(comment) {
- append body "- [ns_quotehtml $comment]\n"
+ append body "
- [ns_quotehtml $comment]\n"
}
append body "
\n"
}
if { [info exists property(headers)] } {
append body {Headers
-
+
}
foreach { name value } $property(headers) {
- append body [subst {
-
- $name: |
- [ns_quotehtml $value] |
-
- }]
+ append body [subst {
+
+ $name: |
+ [ns_quotehtml $value] |
+
+ }]
}
append body " \n"
}
if { [info exists property(oheaders)] } {
append body {Output Headers
-
+
}
foreach { name value } $property(oheaders) {
- append body [subst {
-
- $name: |
- [ns_quotehtml $value] |
-
- }]
+ append body [subst {
+
+ $name: |
+ [ns_quotehtml $value] |
+
+ }]
}
append body " \n"
}
@@ -221,25 +221,25 @@
foreach { handle command statement_name sql start end errno return } $property(db) {
- if { $handle ne "" && [info exists pool($handle)] } {
- set statement_pool $pool($handle)
- } else {
- set statement_pool ""
- }
+ if { $handle ne "" && [info exists pool($handle)] } {
+ set statement_pool $pool($handle)
+ } else {
+ set statement_pool ""
+ }
- if { $command eq "gethandle" } {
- # Remember which handle was acquired from which pool.
- set statement_pool $sql
- set value "gethandle (returned $return)"
- set pool($return) $sql
- } elseif { $command eq "releasehandle" } {
- set value "releasehandle $handle"
- } else {
- if { $statement_name eq "" } {
- set value ""
- } else {
- set value "$statement_name: "
- }
+ if { $command eq "gethandle" } {
+ # Remember which handle was acquired from which pool.
+ set statement_pool $sql
+ set value "gethandle (returned $return)"
+ set pool($return) $sql
+ } elseif { $command eq "releasehandle" } {
+ set value "releasehandle $handle"
+ } else {
+ if { $statement_name eq "" } {
+ set value ""
+ } else {
+ set value "$statement_name: "
+ }
# Remove extra whitespace before query
set min_whitespace -1
@@ -262,8 +262,8 @@
set sql $new_sql
}
- append value "$command $statement_pool $handle[ns_quotehtml $sql] "
- }
+ append value "$command $statement_pool $handle[ns_quotehtml $sql] "
+ }
if { $command ne "getrow" || [template::util::is_true $getrow_p] } {
multirow append dbreqs $handle [lindex $command 0] $sql [format %.2f [expr { $end - $start }]] $value
@@ -291,41 +291,41 @@
aggregate_label "Total Duration (ms)"
display_template {@dbreqs.value;noquote@}
}
- } -filters {
- getrow_p {
- label "Getrow"
- values {
- {"Include" t}
- {"Exclude" f}
- }
- default_value t
+ } -filters {
+ getrow_p {
+ label "Getrow"
+ values {
+ {"Include" t}
+ {"Exclude" f}
}
- request {
- hide_p t
- }
+ default_value t
}
+ request {
+ hide_p t
+ }
+ }
}
# Profiling information
global ds_profile__total_ms ds_profile__iterations
template::list::create -name profiling -multirow profiling -elements {
- file_links {
- label "Ops"
- display_template {
- @profiling.file_links;noquote@
- }
- }
- tag {
- label "Template"
- }
- total_ms {
- label "Total time"
- }
- size {
- label "Size"
- }
+ file_links {
+ label "Ops"
+ display_template {
+ @profiling.file_links;noquote@
+ }
+ }
+ tag {
+ label "Template"
+ }
+ total_ms {
+ label "Total time"
+ }
+ size {
+ label "Size"
+ }
}
multirow create profiling tag total_ms file_links size
|
---|