Index: openacs-4/packages/xotcl-request-monitor/COPYRIGHT =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/COPYRIGHT,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xotcl-request-monitor/COPYRIGHT 30 Dec 2005 00:07:23 -0000 1.1 @@ -0,0 +1,26 @@ + * xotcl-request-monitor + * + * Copyright (C) 2005 Gustaf Neumann, neumann@wu-wien.ac.at + * + * Vienna University of Economics and Business Administration + * Institute of Information Systems and New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * This is a BSD-Style license applicable for the files in this + * directory and below, except when stated explicitly different. + * + * For the copyright of the diagramm javascript library see: + * http://www.lutanho.net/diagram/ + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + + 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.1 -r1.2 --- openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info 14 Dec 2005 16:09:02 -0000 1.1 +++ openacs-4/packages/xotcl-request-monitor/xotcl-request-monitor.info 30 Dec 2005 00:07:23 -0000 1.2 @@ -8,10 +8,10 @@ t request-monitor - + Gustaf Neumann Request Monitor with user tracking functionality - 2005-12-11 + 2005-12-29 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, @@ -25,7 +25,7 @@ ns_returnfile_background is included 0 - + Index: openacs-4/packages/xotcl-request-monitor/tcl/background-delivery-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/tcl/Attic/background-delivery-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xotcl-request-monitor/tcl/background-delivery-procs.tcl 14 Dec 2005 16:09:02 -0000 1.1 +++ openacs-4/packages/xotcl-request-monitor/tcl/background-delivery-procs.tcl 30 Dec 2005 00:07:23 -0000 1.2 @@ -39,21 +39,35 @@ @return number of currently running background deliveries } %self do array size running +if {[ns_info name] eq "NaviServer"} { + bgdelivery forward write_headers ns_headers +} else { + bgdelivery forward write_headers ns_headers DUMMY +} -ad_proc -public ad_returnfile_background {statuscode mime_type filename} { +bgdelivery ad_proc returnfile {statuscode mime_type filename} { Deliver the given file to the requestor in the background. This proc uses the background delivery thread to send the file in an event-driven manner without blocking a request thread. This is especially important when large files are requested over slow (e.g. dial-ip) connections. } { #ns_log notice "statuscode = $statuscode, filename=$filename" set size [file size $filename] - if {[ns_headers xxx $statuscode $mime_type $size]} { + if {[my write_headers $statuscode $mime_type $size]} { set ch [ns_conn channel] - thread::transfer [bgdelivery get_tid] $ch + thread::transfer [my get_tid] $ch throttle get_context - bgdelivery do -async deliver $ch $filename \ + my do -async deliver $ch $filename \ [list [throttle set requestor],[throttle set url] [ns_conn start]] - ns_conn contentsentlength $size; #maybe overly optimistic + ns_conn contentsentlength $size ;# maybe overly optimistic } } + +ad_proc -public ad_returnfile_background {statuscode mime_type filename} { + Deliver the given file to the requestor in the background. This proc uses the + background delivery thread to send the file in an event-driven manner without + blocking a request thread. This is especially important when large files are + requested over slow (e.g. dial-ip) connections. +} { + bgdelivery returnfile $statuscode $mime_type $filename +} 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.1 -r1.2 --- openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 14 Dec 2005 16:09:02 -0000 1.1 +++ openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-procs.tcl 30 Dec 2005 00:07:23 -0000 1.2 @@ -19,7 +19,7 @@ } Throttle instproc add_statistics { type requestor ip_adress url query } { - set furl [expr {$query != "" ? "$url?$query" : $url}] + set furl [expr {$query ne "" ? "$url?$query" : $url}] my incr ${type}s #my log "++++ add_statistics -type $type -user_id $requestor " set entry [ThrottleStat new -childof [self]::stats \ @@ -73,7 +73,7 @@ # issued; if yes, block this request. Caveat: some html-pages # use the same image in many places, so we can't block it. This # will make the sttistics for images look better than they are. - set is_image_request [string match image/* $content_type] + set is_image_request [string match "image/*" $content_type] if {[my exists $var] && !$is_image_request && !$off} { my log "### already $var" return [list 0 0 1] @@ -822,6 +822,7 @@ my users community_access [my set requestor] $community_id } } +throttle proc {} args {my eval $args} ad_proc string_truncate_middle {{-ellipsis ...} {-len 100} string} { cut middle part of a string in case it is to long Index: openacs-4/packages/xotcl-request-monitor/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xotcl-request-monitor/www/index.tcl 14 Dec 2005 16:09:02 -0000 1.1 +++ openacs-4/packages/xotcl-request-monitor/www/index.tcl 30 Dec 2005 00:07:23 -0000 1.2 @@ -41,7 +41,7 @@ proc currentResponseTime {} { set tm [throttle trend response_time_minutes] set hours [throttle trend response_time_hours] - if { $tm == "" } { + if { $tm eq "" } { set ::server_running "seconds" return "NO DATA" } @@ -79,7 +79,7 @@ proc currentViews {} { set vm [throttle trend minutes] set um [throttle trend user_count_minutes] - if { $vm == "" } { return "NO DATA" } + if { $vm eq "" } { return "NO DATA" } set views_per_sec [expr {[lindex $vm end]/60.0}] ns_log notice "um='$um' vm='$vm' expr {60.0*$views_per_sec/[lindex $um end]}" set views_per_min_per_user [expr {60.0*$views_per_sec/[lindex $um end]}] @@ -239,7 +239,7 @@ append running /[bgdelivery nr_running] } -if {[string compare "" [info command ::tlf::system_activity]]} { +if {[info command ::tlf::system_activity] ne ""} { array set server_stats [::tlf::system_activity] set current_exercise_activity $server_stats(activity) set current_system_activity "$server_stats(activity) exercises last 15 mins, " Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/xotcl-request-monitor/www/index.tcl-gn'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/xotcl-request-monitor/www/last100.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/www/last100.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xotcl-request-monitor/www/last100.tcl 14 Dec 2005 16:09:02 -0000 1.1 +++ openacs-4/packages/xotcl-request-monitor/www/last100.tcl 30 Dec 2005 00:07:23 -0000 1.2 @@ -49,4 +49,5 @@ -ms $ms \ -url $url } -set t1 [t1 asHTML] \ No newline at end of file +set t1 [t1 asHTML] +