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.60 -r1.61 --- openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 19 Sep 2018 01:02:10 -0000 1.60 +++ openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 3 Nov 2018 10:40:10 -0000 1.61 @@ -513,20 +513,26 @@ next } - Class create MaxCounter -superclass Counter -instproc end {} { - set :c [Users nr_active] - if {[info exists :report]} { - if {[${:report} set c] < ${:c}} { - ${:report} set c ${:c} + Class create MaxCounter -superclass Counter \ + -parameter {{metric nr_active}} \ + -instproc end {} { + set :c [Users ${:metric}] + if {[info exists :report]} { + if {[${:report} set c] < ${:c}} { + ${:report} set c ${:c} + } + } + :finalize ${:c} + set :c 0 } - } - :finalize ${:c} - set :c 0 - } MaxCounter create user_count_hours -timeoutMs [expr {60000*60}] -logging 1 MaxCounter create user_count_minutes -timeoutMs 60000 -report user_count_hours -logging 1 + MaxCounter create authenticated_count_hours -metric nr_authenticated -timeoutMs [expr {60000*60}] -logging 1 + MaxCounter create authenticated_count_minutes -metric nr_authenticated -timeoutMs 60000 \ + -report authenticated_count_hours -logging 1 + Class create AvgCounter -superclass Counter \ -parameter {{t 0} {atleast 1}} -instproc end {} { if {${:c} > 0} { @@ -701,6 +707,11 @@ } { return [array size :pa] } + Users ad_proc nr_authenticated {} { + @return number of authenticated users (in time window) + } { + return [lindex [:nr_users_time_window] 1] + } Users ad_proc nr_users_time_window {} { @return number of different ip addresses and authenticated users (in time window)