Index: openacs-4/packages/acs-developer-support/www/request-info.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/www/request-info.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-developer-support/www/request-info.adp 30 Dec 2003 22:46:17 -0000 1.1
+++ openacs-4/packages/acs-developer-support/www/request-info.adp 14 Jan 2004 08:58:34 -0000 1.2
@@ -3,3 +3,6 @@
\n" + + # TODO: Sort by duration, so you can see slowest queries at top + template::list::create \ + -name dbreqs \ + -elements { + duration_ms { + label "Duration" + html { align right } + display_template {@dbreqs.duration_ms@ ms} + aggregate sum + } + command { + label "Command" + } + sql { + label "SQL" + aggregate_label "Total Duration (ms)" + display_template {@dbreqs.value;noquote@} + } + } -filters { + getrow_p { + label "Getrow" + values { + {"Include" t} + {"Exclude" f} + } + default_value t + } + request {} + } + }-
-\n" + multirow create dbreqs handle command sql duration_ms value - set colors { #DDDDDD #FFFFFF } - - set total 0 - - set counter 0 foreach { handle command statement_name sql start end errno return } $property(db) { - set bgcolor [lindex $colors [expr { $counter % [llength $colors] }]] if { ![empty_string_p $handle] && [info exists pool($handle)] } { set statement_pool $pool($handle) } else { set statement_pool "" } - + if { $command == "gethandle" } { # Remember which handle was acquired from which pool. set statement_pool $sql @@ -228,15 +221,47 @@ } else { set value "$statement_name: " } - append value "$command $handle Duration Pool Command \n" + + # TODO: Remove extra whitespace before query + + append value "$command $handle[ns_quotehtml $sql]" } - append body "[ns_quotehtml $sql]\n" - incr counter + if { ![string equal $command "getrow"] || [template::util::is_true $getrow_p] } { + multirow append dbreqs $handle $command $sql [expr { $end - $start }] $value + } - incr total [expr { $end - $start }] } - append body " [format "%.f" [expr { ($end - $start) }]] ms $statement_pool $value \n" - append body " [format "%.f" [expr { $total }]] ms (total)