acs-developer-support-procs.tcl

Provides routines used to aggregate request/response information for debugging.

Location:
packages/acs-developer-support/tcl/acs-developer-support-procs.tcl
Created:
22 Apr 2000
Author:
Jon Salz

Procedures in this file

Detailed information

ds_ad_conn (private)

 ds_ad_conn [ args... ]

Get the "real" user id.

Testcases:
No testcase defined.

ds_add (public)

 ds_add name [ args... ]

Sets a developer-support property for the current request.

Parameters:
name (required)

Testcases:
ds_add_test

ds_adp_box_class (public)

 ds_adp_box_class

Return developer support adp box class on/off

Testcases:
ds_adp_reveal_test

ds_adp_end_box (public)

 ds_adp_end_box [ -stub stub ]

Appends adp end box if the show toggle is true

Switches:
-stub (optional, defaults to "$__adp_stub")

Testcases:
callgraph__bad_page_calls, web_forum_new, web_forum_edit, web_forums_message_and_reply

ds_adp_file_class (public)

 ds_adp_file_class

Return developer support adp file on/off

Testcases:
ds_adp_reveal_test

ds_adp_output_class (public)

 ds_adp_output_class

Return developer support adp output on/off

Testcases:
ds_adp_reveal_test

ds_adp_reveal_enabled_p (private)

 ds_adp_reveal_enabled_p

Returns true if developer-support adp revealing facilities are enabled.

Testcases:
ds_adp_reveal_test

ds_adp_start_box (public)

 ds_adp_start_box [ -stub stub ]

Appends adp start box if the show toggle is true

Switches:
-stub (optional, defaults to "$__adp_stub")

Testcases:
callgraph__bad_page_calls, web_forum_new, web_forum_edit, web_forums_message_and_reply

ds_collect_connection_info (public)

 ds_collect_connection_info

Collect information about the current connection. Should be called only at the very beginning of the request processor handler.

Testcases:
No testcase defined.

ds_collect_db_call (public)

 ds_collect_db_call db command statement_name sql start_time errno \
    error

Collects stats for a single database call

Parameters:
db (required)
command (required)
statement_name (required)
sql (required)
start_time (required)
errno (required)
error (required)

Testcases:
ds_add_test

ds_collection_enabled_p (public)

 ds_collection_enabled_p

Returns whether we're collecting information about this request

Testcases:
ds_features_enabled_test

ds_comment (public)

 ds_comment value

Adds a comment to the developer-support information for the current request.

Parameters:
value (required)

Testcases:
ds_add_test

ds_comments_p (private)

 ds_comments_p

Should we show comments inline on the page?

Testcases:
No testcase defined.

ds_conn (private)

 ds_conn [ args... ]

Developer support version of ad_conn. Overloads "ad_conn user_id", delegates to ad_conn in all other cases.

Testcases:
No testcase defined.

ds_database_enabled_p (public)

 ds_database_enabled_p

Returns true if developer-support database facilities are enabled.

Testcases:
ds_features_enabled_test

ds_enabled_p (public)

 ds_enabled_p
Returns:
true if developer-support facilities are enabled.

Testcases:
ds_features_enabled_test

ds_get_comments (private)

 ds_get_comments

Get comments for the current request.

Testcases:
No testcase defined.

ds_get_db_command_info (private)

 ds_get_db_command_info

Get a Tcl list with { num_commands total_ms } for the database commands for the request.

Returns:
list containing num_commands and total_ms, or empty string if the information is not available.

Testcases:
No testcase defined.

ds_get_page_serve_time_ms (private)

 ds_get_page_serve_time_ms

Returns the number of milliseconds passed since this request thread was started. Returns the empty string if this information is not available.

Testcases:
No testcase defined.

ds_get_real_user_id (private)

 ds_get_real_user_id

Get the "real" user id.

Testcases:
No testcase defined.

ds_get_user_id (private)

 ds_get_user_id [ original ]

Developer support version of ad_get_user_id, used for debugging sites.

Parameters:
original (optional, defaults to "0")

Testcases:
No testcase defined.

ds_init (public)

 ds_init

Perform setup for the developer support for a single request. We save the state in global variables to avoid highly redundant computations (up to 50 times per page on openacs.org)

Testcases:
ds_features_enabled_test

ds_instance_id (private)

 ds_instance_id
Returns:
The instance of a running acs developer support.

Testcases:
No testcase defined.

ds_link (public)

 ds_link

Returns the "Developer Information" link in a right-aligned table, if enabled.

Testcases:
ds_link_test

ds_lookup_administrator_p (private, deprecated)

 ds_lookup_administrator_p user_id
Deprecated. Invoking this procedure generates a warning.

Parameters:
user_id (required)

Testcases:
No testcase defined.

ds_page_fragment_cache_enabled_p (public)

 ds_page_fragment_cache_enabled_p

Are we populating the page fragment cache?

Testcases:
ds_features_enabled_test

ds_permission_p (private)

 ds_permission_p

Do we have permission to view developer support stuff.

Testcases:
No testcase defined.

ds_profile (public)

 ds_profile command [ tag ]

Helper proc for performance profiling of templates. 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).

Parameters:
command (required)
Must be "start" or "stop".
tag (optional)
In practice, the path to the template being profiled.
  • start marks the beginning of a block.
  • stop marks the end of a block. Start and stops must match.

Testcases:
ds_add_test

ds_profiling_enabled_p (public)

 ds_profiling_enabled_p

Returns true if developer-support template profiling facilities are enabled.

Testcases:
ds_features_enabled_test

ds_replace_get_user_procs (private)

 ds_replace_get_user_procs enabled_p

Replace the ad_get_user procs with our own versions

Parameters:
enabled_p (required)

Testcases:
No testcase defined.

ds_require_permission (private)

 ds_require_permission object_id privilege

Requires the user identified by ds_add_conn user_id to have the given privilege on the given object.

Parameters:
object_id (required)
privilege (required)

Testcases:
No testcase defined.

ds_set_adp_reveal_enabled (private)

 ds_set_adp_reveal_enabled enabled_p

Enables/disables database statistics in a safe manner.

Parameters:
enabled_p (required)
Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000

Testcases:
ds_adp_reveal_test

ds_set_database_enabled (private)

 ds_set_database_enabled enabled_p

Enables/disables database statistics in a safe manner.

Parameters:
enabled_p (required)
Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000

Testcases:
No testcase defined.

ds_set_profiling_enabled (private)

 ds_set_profiling_enabled enabled_p

Enables/disables profiling statistics in a safe manner.

Parameters:
enabled_p (required)
Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000

Testcases:
No testcase defined.

ds_set_user_switching_enabled (private)

 ds_set_user_switching_enabled enabled_p

Enables/disables user-switching in a safe manner.

Parameters:
enabled_p (required)
Author:
Lars Pind <lars@pinds.com>
Created:
31 August 2000

Testcases:
No testcase defined.

ds_show_p (public)

 ds_show_p

Should we show developer-support on the current connection.

Testcases:
ds_features_enabled_test

ds_support_url (private)

 ds_support_url
Returns:
A link to the first instance of the developer-support information available in the site node, the empty_string if none are available.

Testcases:
No testcase defined.

ds_sweep_data (private)

 ds_sweep_data

Testcases:
No testcase defined.

ds_trace_filter (private)

 ds_trace_filter why [ args... ]

Adds developer-support information about the end of sessions.

Parameters:
why (required)

Testcases:
No testcase defined.

ds_user_select_widget (private)

 ds_user_select_widget

Build a select widget for users in the system, for quick user switching. WARNING: On instances with high numbers of users, the query might return high number of instances, leading to very slow pages. So, the number of users returned is limited to 100. For testing purposes, a different selection of users is probably preferred. The current query does not work for Oracle.

Testcases:
No testcase defined.

ds_user_switching_enabled_p (private)

 ds_user_switching_enabled_p

Returns whether user-switching is enabled.

Testcases:
No testcase defined.

ds_watch_packages (private)

 ds_watch_packages

Watch Tcl libraries and xql files for packages listed in the PackageWatchList parameter on server startup.

Author:
Peter Marklund

Testcases:
No testcase defined.
[ show source ]