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.49 -r1.50 --- openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 21 Dec 2008 18:09:53 -0000 1.49 +++ openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 9 Jan 2010 01:56:09 -0000 1.50 @@ -94,6 +94,12 @@ return [nsv_get ds_properties database_enabled_p] } + ad_proc -public ds_profiling_enabled_p {} { + Returns true if developer-support template profiling facilities are enabled. + } { + return [nsv_get ds_properties profiling_enabled_p] + } + ad_proc -public ds_page_fragment_cache_enabled_p {} { o Are we populating the page fragment cache? } { @@ -347,7 +353,6 @@ ad_proc -private ds_add { name args } { Sets a developer-support property for the current request. - Should never be used except by elements of the request processor (e.g., security filters or abstract URLs). } { if { [ds_enabled_p] && [ds_collection_enabled_p] } { @@ -532,6 +537,16 @@ nsv_set ds_properties user_switching_enabled_p $enabled_p } +ad_proc -public ds_set_profiling_enabled { enabled_p } { + Enables/disables profiling statistics in a safe manner. + + @author Lars Pind (lars@pinds.com) + @creation-date 31 August 2000 +} { + ns_log Notice "Developer-support profiling stats [ad_decode $enabled_p 1 "enabled" "disabled"]" + nsv_set ds_properties profiling_enabled_p $enabled_p +} + ad_proc -public ds_set_database_enabled { enabled_p } { Enables/disables database statistics in a safe manner. @@ -630,69 +645,42 @@ } ad_proc -public ds_profile { command {tag {}} } { - Helper proc for performance profiling. - This will count the number of invocations of the given tag, the total time spent within all invocations - (between the corresponding 'ds_profile start' and 'ds_profile stop' invocations). - The results will be output at the bottom of the page, and include the average time spent per invocation. + Helper proc for performance profiling of templates. - @param command + This will record the total time spent within an invocation of a template (computed as + time between the 'ds_profile start' and 'ds_profile stop' invocations inserted by the + template engine). + + @param command Must be "start" or "stop". + @param tag In practice, the path to the template being profiled.