Index: openacs-4/packages/acs-developer-support/lib/toolbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/lib/toolbar.tcl,v diff -u -r1.13.4.2 -r1.13.4.3 --- openacs-4/packages/acs-developer-support/lib/toolbar.tcl 9 Feb 2014 02:16:02 -0000 1.13.4.2 +++ openacs-4/packages/acs-developer-support/lib/toolbar.tcl 10 Feb 2014 20:27:44 -0000 1.13.4.3 @@ -65,7 +65,11 @@ set db_info [ds_get_db_command_info] set db_num_cmds [lindex $db_info 0] - set db_num_ms [lc_numeric [lindex $db_info 1]] + if {[lindex $db_info 1] eq ""} { + set db_num_ms [lc_numeric [lindex $db_info 1]] + } else { + set db_num_ms [lc_numeric [format %.1f [lindex $db_info 1]]] + } set flush_url [export_vars -base "[ad_url]/acs-admin/cache/flush-cache" { { suffix util_memoize } { return_url [ad_return_url] } }] Index: openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl,v diff -u -r1.52.2.12 -r1.52.2.13 --- openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 21 Oct 2013 07:40:22 -0000 1.52.2.12 +++ openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 10 Feb 2014 20:27:44 -0000 1.52.2.13 @@ -203,13 +203,13 @@ set total 0 set counter 0 foreach { handle command statement_name sql start end errno error } [nsv_get ds_request $::ad_conn(request).db] { - incr total [expr { $end - $start }] - if { [lsearch { dml exec 1row 0or1row select } [lindex $command 0]] >= 0 } { + set total [expr { $total + ($end - $start) }] + if { [lindex $command 0] in { dml exec 1row 0or1row select } } { incr counter } } if { $counter > 0 } { - append out "$counter database command[ad_decode $counter 1 " taking" "s totalling"] [format {%.f} [expr { $total }]] ms
" + append out "$counter database command[ad_decode $counter 1 " taking" "s totalling"] [format {%.f} $total] ms
" } } @@ -277,8 +277,8 @@ set total 0 set counter 0 foreach { handle command statement_name sql start end errno error } [nsv_get ds_request $::ad_conn(request).db] { - incr total [expr { $end - $start }] - if { [lsearch { dml exec 1row 0or1row select } [lindex $command 0]] >= 0 } { + set total [expr { $total + ($end - $start) }] + if { [lindex $command 0] in { dml exec 1row 0or1row select } } { incr counter } } @@ -343,7 +343,7 @@ } } - ds_add db $db $command $statement_name $bound_sql $start_time [clock clicks -milliseconds] $errno $error + ds_add db $db $command $statement_name $bound_sql $start_time [clock clicks -microseconds] $errno $error } } Index: openacs-4/packages/acs-developer-support/www/request-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/www/request-info.tcl,v diff -u -r1.18.2.2 -r1.18.2.3 --- openacs-4/packages/acs-developer-support/www/request-info.tcl 26 Oct 2013 09:35:01 -0000 1.18.2.2 +++ openacs-4/packages/acs-developer-support/www/request-info.tcl 10 Feb 2014 20:27:45 -0000 1.18.2.3 @@ -256,12 +256,12 @@ } if { $command ne "getrow" || [template::util::is_true $getrow_p] } { - multirow append dbreqs $handle $command $sql [expr { $end - $start }] $value + multirow append dbreqs $handle $command $sql [format %.2f [expr { $end - $start }]] $value } } - multirow sort dbreqs -integer -decreasing duration_ms + multirow sort dbreqs -real -decreasing duration_ms template::list::create \ -name dbreqs \ Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v diff -u -r1.86.2.10 -r1.86.2.11 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 6 Dec 2013 08:59:32 -0000 1.86.2.10 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 10 Feb 2014 20:27:44 -0000 1.86.2.11 @@ -495,7 +495,7 @@ } if { $db_state(n_handles_used) >= [llength $db_state(handles)] } { set pool [db_nth_pool_name -dbn $dbn $db_state(n_handles_used)] - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] set errno [catch { set db [ns_db gethandle $pool] } error] @@ -768,7 +768,7 @@ @see db_exec_plsql } { - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] set sql [db_qd_replace_sql $statement_name $pre_sql] @@ -951,7 +951,7 @@ break } - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] ns_db releasehandle $db ds_collect_db_call $db releasehandle "" "" $start_time 0 "" incr index_to_examine -1 @@ -967,7 +967,7 @@ routines as necessary. } { - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] set errno [catch { return [ns_db getrow $db $selection] } error] ds_collect_db_call $db getrow "" "" $start_time $errno $error if { $errno == 2 } { @@ -984,7 +984,7 @@ (if set). } { - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] set start_time_fine [clock seconds] set driverkey [db_driverkey -handle_p 1 $db] @@ -3176,7 +3176,7 @@ depending on the value of the $bind variable in the calling environment (if set). } { - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] set sql [db_qd_replace_sql $statement_name $pre_sql] @@ -3299,7 +3299,7 @@ Low level replacement for db_exec which emulates blob handling. } { - set start_time [clock clicks -milliseconds] + set start_time [clock clicks -microseconds] # Query Dispatcher (OpenACS - ben) set sql [db_qd_replace_sql $statement_name $pre_sql]