Index: openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info 13 Sep 2007 12:06:56 -0000 1.4 +++ openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info 14 Oct 2007 16:39:41 -0000 1.5 @@ -8,31 +8,31 @@ <singleton-p>t</singleton-p> <auto-mount>request-monitor</auto-mount> - <version name="0.39" url="http://media.wu-wien.ac.at/download/xotcl-request-monitor-0.39.apm"> + <version name="0.40" url="http://media.wu-wien.ac.at/download/xotcl-request-monitor-0.40.apm"> <owner url="mailto:neumann@wu-wien.ac.at">Gustaf Neumann</owner> <summary>Request Monitor with user tracking functionality</summary> - <release-date>2006-08-16</release-date> - <description format="text/html">This package provides a Request Monitor for OACS applications. It computes performance summary information such as requests/views per seconds, average response time, number of users connected, lists currently active threads, etc. Furthermore it can block overactive users (e.g. automated web-bots mirroring the site, users repeating running queries, etc.). It provides as well some user tracking (such as whos-online) with activity measures, it blocks repeated requests (impatient reloads), tracks switching of IP-adresses from users and provides request tracking per user for the monitored time window. It contains as well overall url statistics with performance measures. Updated for cirumventing handler calls openacs 5.2 for /resources/*. -0.28 provides calles for listing active communities and users active in these communities. -0.30 provides a nice graphical chats (many thanks to Nima) and a new interface to the background thread. In addition, ns_returnfile_background is included; -0.38 using context form xotcl-core + <release-date>2007-10-14</release-date> + <description format="text/html">This package provides a Request Monitor for OACS applications. It computes performance summary information such as requests/views per seconds, average response time, number of users connected, lists currently active threads, etc. Furthermore it can block overactive users (e.g. automated web-bots mirroring the site, users repeating running queries, etc.). It provides as well some user tracking (such as whos-online) with activity measures, it blocks repeated requests (impatient reloads), tracks switching of IP-adresses from users and provides request tracking per user for the monitored time window. It contains as well overall url statistics with performance measures. Updated for cirumventing handler calls openacs 5.2 for /resources/*. +0.28 provides calles for listing active communities and users active in these communities. +0.30 provides a nice graphical chats (many thanks to Nima) and a new interface to the background thread. In addition, ns_returnfile_background is included; +0.38 using context form xotcl-core 0.39 brings parameterized counter values</description> - <maturity>0</maturity> - <provides url="xotcl-request-monitor" version="0.38"/> + <provides url="xotcl-request-monitor" version="0.40"/> <requires url="xotcl-core" version="0.43"/> <callbacks> </callbacks> <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="hide-requests" default="*.css *.ico" description="List of glob patterns to be used for hiding entries from request lists. Only requests that do not match any of these patterns are displayed unless all requests are forced. Affected pages: - stat-details (list of all recorded urls with timings) - last-requests (tracking activity of a user) "/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="max-stats-elements" default="5" description="Number of highest data points in the reporting period. The default of 5 will e.g. show you the top 5 times of requests per minute, hour aso."/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="max-url-stats" default="100" description="Number of URL entries to be kept in the detailed view of the request statistics"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="peer-groups" default="*wlan* *dsl* *.com *.net *.org" description="List of glob patterns for the summary of sites when an admin uses .../whos-online/. These patterns are matched against the domain names of the peer adresses."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="request-blocking-off" default="0" description="switch request blocking on/off"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="time-window" default="10" description="Defines the time window in minutes which is used for detailed monitoring (e.g. calculate the number of active uses and the history of the requests of these users, the numer of ip switches, etc.)"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="trend-elements" default="48" description="Number of data points used for displaying the trend graphs. The default will show the trend for the last 48 seconds,minutes,hours. It is also the maximum reporting period possible"/> - <parameter datatype="number" min_n_values="1" max_n_values="1" name="max-stats-elements" default="5" description="Number of highest data points in the reporting period. The default of 5 will e.g. show you the top 5 times of requests per minute, hour aso."/> </parameters> </version> Index: openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 18 Sep 2007 10:21:44 -0000 1.12 +++ openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 14 Oct 2007 16:39:41 -0000 1.13 @@ -1,7 +1,9 @@ ############################################################################# ::xotcl::THREAD create throttle { - # + #set package_id [::xo::parameter get_package_id_from_package_key \ + # -package_key "xotcl-request-monitor"] + # # A simple helper class to provide a faster an easier-to-use interface to # package parameters. Eventually, this will move in a more general # way into xotcl-core. @@ -25,6 +27,7 @@ package_parameter time-window -default 13 package_parameter trend-elements -default 48 package_parameter max-stats-elements -default 5 + package_parameter request-blocking-off -default 0 # # When updates happen on @@ -42,6 +45,10 @@ Counter set_in_all_instances nr_trend_elements $value } + request-blocking-off proc update {value} { + throttler set off $value + } + # get the value from the logdir parameter set ::logdir [log-dir] if {![file isdirectory $logdir]} {file mkdir $logdir} @@ -63,7 +70,7 @@ } Throttle instproc init {} { - my set off 0 + my set off [request-blocking-off] Object create [self]::stats Object create [self]::users next @@ -714,7 +721,7 @@ # # Populate the counters from log file # - ns_log notice "+++ initialize conters" + ns_log notice "+++ request-monitor: initialize counters" # Create the file to load. This is per hour = 60*3 + 2 lines set number_of_lines [expr {182 * [trend-elements]}] @@ -723,7 +730,7 @@ set f [open $logdir/counter-new.log] while {-1 != [gets $f line]} { regexp {(.*) -- (.*) ::(.*) (.*)} $line match timestamp server counter value - ns_log notice "$counter add_value $timestamp $value" + #ns_log notice "$counter add_value $timestamp $value" $counter add_value $timestamp $value }