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 -N -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 @@ t request-monitor - + Gustaf Neumann Request Monitor with user tracking functionality - 2006-08-16 - 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 + 2007-10-14 + 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 - 0 - + + + - 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 -N -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 }