Index: openacs-4/packages/xotcl-request-monitor/www/stat-details.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/www/stat-details.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/xotcl-request-monitor/www/stat-details.tcl 4 Aug 2018 18:55:48 -0000 1.13
+++ openacs-4/packages/xotcl-request-monitor/www/stat-details.tcl 3 Sep 2024 15:37:54 -0000 1.14
@@ -5,9 +5,9 @@
@cvs-id $Id$
} -query {
- {all:optional 0}
- {with_param:optional 1}
- {with_apps:optional 0}
+ {all:boolean,optional,notnull 0}
+ {with_param:boolean,optional,notnull 1}
+ {with_apps:boolean,optional,notnull 0}
{orderby:token,optional "totaltime,desc"}
} -properties {
title:onevalue
@@ -26,9 +26,9 @@
set hide_patterns [parameter::get -parameter hide-requests -default {*.css}]
array set apps {
- calendar 1 acs-templating 1 forums 1 file-storage 1 one-community 1
- xowiki 1
- annotations 1 gradebook 1 homework 1 lecturecast 1 res 1
+ calendar 1 acs-templating 1 forums 1 file-storage 1 one-community 1
+ xowiki 1
+ annotations 1 gradebook 1 homework 1 lecturecast 1 res 1
}
array set vuh {
ical 1
@@ -137,29 +137,17 @@
set with_apps_tooltip(0) "Statistics without Communities"
set not_with_apps [expr {!$with_apps}]
-set url_all [export_vars -base [ad_conn url] [list [list all $not_all] with_apps with_param]]
-set url_apps [export_vars -base [ad_conn url] [list all [list with_apps $not_with_apps] with_param]]
-set url_param [export_vars -base [ad_conn url] [list all with_apps [list with_param $not_with_param]]]
+set url_all [export_vars -base [ad_conn url] {{all $not_all} with_apps with_param}]
+set url_apps [export_vars -base [ad_conn url] {all {with_apps $not_with_apps} with_param}]
+set url_param [export_vars -base [ad_conn url] {all with_apps {with_param $not_with_param}}]
-switch -glob $orderby {
- *,desc {set order -decreasing}
- *,asc {set order -increasing}
-}
-switch -glob $orderby {
- url,* {set index 0; set type -dictionary}
- totaltime,* {set index 1; set type -integer}
- cnt,* {set index 2; set type -integer}
- avg,* {set index 3; set type -real}
-}
-
-
TableWidget create t1 -volatile \
-actions [subst {
Action new -label "$show_all_label($all)" -url $url_all -tooltip "show_all_tooltip($all)"
Action new -label "$with_param_label($with_param)" -url $url_param -tooltip "with_param_tooltip($with_param)"
Action new -label "$with_apps_label($with_apps)" -url $url_apps -tooltip "with_apps_tooltip($with_apps)"
Action new -label "Delete Statistics" -url flush-url-statistics \
- -tooltip "Delete URL Statistics"
+ -tooltip "Delete URL Statistics"
}] \
-columns {
AnchorField url -label "Request" -orderby url
@@ -172,35 +160,41 @@
set nr 0
set hidden 0
set all [expr {!$all}]
- foreach l [lsort $type $order -index $index $full_stat] {
+ foreach l $full_stat {
set avg [expr {[lindex $l 1]/[lindex $l 2]}]
set rel [expr {($avg/1000.0)/$total_avg}]
set url [lindex $l 0]
if {!$all} {
set exclude 0
foreach pattern $hide_patterns {
- if {[string match $pattern $url]} {
- set exclude 1
- incr hidden
- break
- }
+ if {[string match $pattern $url]} {
+ set exclude 1
+ incr hidden
+ break
+ }
}
if {$exclude} continue
}
-
- t1 add -url [string_truncate_middle -len 80 $url] \
- -url.href [expr {[string match "*...*" $url] ? "" : "[ad_url]$url" }] \
- -totaltime [lindex $l 1] \
- -cnt [lindex $l 2] \
- -avg $avg \
- -total [format %.2f%% [expr {[lindex $l 1]*100.0/$total}]]
+
+ t1 add -url [ad_string_truncate_middle -len 80 $url] \
+ -url.href [expr {[string match "*...*" $url] ? "" : "[ad_url]$url" }] \
+ -totaltime [lindex $l 1] \
+ -cnt [lindex $l 2] \
+ -avg $avg \
+ -total [format %.2f%% [expr {[lindex $l 1]*100.0/$total}]]
}
+lassign [split $orderby ,] att order
+t1 orderby \
+ -order [ad_decode $order desc decreasing asc increasing increasing] \
+ -type [ad_decode $att totaltime integer cnt integer avg real dictionary] \
+ $att
+
set t1 [t1 asHTML]
append user_string "Grand Total Avg Response time: " \
- [format %6.2f $total_avg] " seconds/call " \
- "(base: $total_cnt requests)
"
+ [format %6.2f $total_avg] " seconds/call " \
+ "(base: $total_cnt requests)
"
append user_string "$hidden requests hidden."
if {$hidden>0} {