| |
248 |
248 |
set trimleft_len [string length [string trimleft $line]] |
| |
249 |
249 |
if { $trimleft_len > 0 } { |
| |
250 |
250 |
set whitespace [expr {$len - $trimleft_len}] |
| |
251 |
251 |
if { $min_whitespace == -1 || $whitespace < $min_whitespace } { |
| |
252 |
252 |
set min_whitespace $whitespace |
| |
253 |
253 |
} |
| |
254 |
254 |
} |
| |
255 |
255 |
} |
| |
256 |
256 |
|
| |
257 |
257 |
if { $min_whitespace > 0 } { |
| |
258 |
258 |
set new_sql {} |
| |
259 |
259 |
foreach line [split $sql \n] { |
| |
260 |
260 |
append new_sql [string range $line $min_whitespace end] \n |
| |
261 |
261 |
} |
| |
262 |
262 |
set sql $new_sql |
| |
263 |
263 |
} |
| |
264 |
264 |
|
| |
265 |
265 |
append value "$command $statement_pool $handle<pre>[ns_quotehtml $sql]</pre>" |
| |
266 |
266 |
} |
| |
267 |
267 |
|
| |
268 |
|
if { $command ne "getrow" || [template::util::is_true $getrow_p] } { |
| |
|
268 |
if { $command ne "getrow" || [string is true -strict $getrow_p] } { |
| |
269 |
269 |
multirow append dbreqs $handle [lindex $command 0] $sql [format %.2f [expr { $end - $start }]] $value |
| |
270 |
270 |
} |
| |
271 |
271 |
|
| |
272 |
272 |
} |
| |
273 |
273 |
|
| |
274 |
274 |
multirow sort dbreqs -real -decreasing duration_ms |
| |
275 |
275 |
|
| |
276 |
276 |
template::list::create \ |
| |
277 |
277 |
-name dbreqs \ |
| |
278 |
278 |
-sub_class narrow \ |
| |
279 |
279 |
-elements { |
| |
280 |
280 |
duration_ms { |
| |
281 |
281 |
label "Duration" |
| |
282 |
282 |
html { align right } |
| |
283 |
283 |
display_template {@dbreqs.duration_ms@ ms} |
| |
284 |
284 |
aggregate sum |
| |
285 |
285 |
} |
| |
286 |
286 |
command { |
| |
287 |
287 |
label "Command" |
| |
288 |
288 |
} |