Home
The Toolkit for Online Communities
17358 Community Members, 1 member online, 2552 visitors today
Log In Register
OpenACS Home : ACS API Browser : ds_get_db_command_info

ds_get_db_command_info (public)

 ds_get_db_command_info
Defined in packages/acs-developer-support/tcl/acs-developer-support-procs.tcl

Get a Tcl list with { num_commands total_ms } for the database commands for the request. Returns the empty string if the information is not available.

Source code:
 
     set result {}
     if { [ds_enabled_p] && [ds_collection_enabled_p] } {
         if { [nsv_exists ds_request $::ad_conn(request).db] } {
             set total 0
             set counter 0
             foreach { handle command statement_name sql start end errno error } [nsv_get ds_request $::ad_conn(request).db] {
                 set total [expr { $total + ($end - $start) }]
                 if { [lindex $command 0] in { dml exec 1row 0or1row select } } {
                     incr counter
                 }
             }
             set result [list $counter $total]
         }
     }
     return $result

Generic XQL file:
packages/acs-developer-support/tcl/acs-developer-support-procs.xql

PostgreSQL XQL file:
packages/acs-developer-support/tcl/acs-developer-support-procs-postgresql.xql

Oracle XQL file:
packages/acs-developer-support/tcl/acs-developer-support-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: