[graph $trend "$label per $l" $l] |
-
- Max |
+ [graph $values $labelList $l] |
+
+ Max |
}]
+ set t [lindex $trends 0]
set c 1
foreach v [throttle max_values $t] {
- incr c
- switch -- $t {
- minutes {set rps "([format %5.2f [expr {[lindex $v 1]/60.0}]] rps)"}
- hours {set rps "([format %5.2f [expr {[lindex $v 1]/(60*60.0)}]] rps)"}
- default {set rps ""}
- }
- set cl [expr {$c%2==0?"list-even":"list-odd"}]
- append text [subst {
- [lindex $v 0] |
- [lindex $v 1] $rps |
- }]
+ incr c
+ switch -- $t {
+ minutes {set rps "([format %5.2f [expr {[lindex $v 1]/60.0}]] rps)"}
+ hours {set rps "([format %5.2f [expr {[lindex $v 1]/(60*60.0)}]] rps)"}
+ default {set rps ""}
+ }
+ set cl [expr {$c%2==0?"list-even":"list-odd"}]
+ append text [subst {
+ [lindex $v 0] |
+ [lindex $v 1] $rps |
+ }]
}
append text " \n | \n"
}
@@ -246,9 +311,11 @@
}
} else {
- # no JavaScript graphics, use poor men's approach...
-
- # draw a graph in form of an html table of with 500 pixels
+ #
+ # No JavaScript graphics, use poor men's approach...
+ #
+ # Draw a graph in form of an HTML table of with 500 pixels.
+ #
proc graph values {
set max 1
foreach v $values {if {$v>$max} {set max $v}}
@@ -261,28 +328,32 @@
return $graph
}
- # build an HTML table from statistics of monitor thread
- proc counterTable {label objlist} {
+ #
+ # Build an HTML table from statistics of monitor thread.
+ # If there are multiple data rows given, just take the first one.
+ #
+ proc counterTable {labels objlist} {
+ set label [lindex $labels 0]
append text "" \
- " | Trend | Max | "
+ " | Trend | Max | "
foreach {t l} $objlist {
- set trend [throttle trend $t]
+ set trend [throttle trend [lindex $t 0]]
append text [subst {
- $label per $l |
- [graph $trend]$trend |
-
-
+ $label per $l |
+ [graph $trend]$trend |
+
+
}]
set c 1
- foreach v [throttle max_values $t] {
- incr c
- switch -- $t {
- minutes {set rps "([format %5.2f [expr {[lindex $v 1]/60.0}]] rps)"}
- hours {set rps "([format %5.2f [expr {[lindex $v 1]/(60*60.0)}]] rps)"}
- default {set rps ""}
- }
- set bg [expr {$c%2==0?"white":"#EAF2FF"}]
- append text "[lindex $v 0] |
+ foreach v [throttle max_values [lindex $t 0]] {
+ incr c
+ switch -- $t {
+ minutes {set rps "([format %5.2f [expr {[lindex $v 1]/60.0}]] rps)"}
+ hours {set rps "([format %5.2f [expr {[lindex $v 1]/(60*60.0)}]] rps)"}
+ default {set rps ""}
+ }
+ set bg [expr {$c%2==0?"white":"#EAF2FF"}]
+ append text " [lindex $v 0] |
[lindex $v 1] $rps | "
}
append text " | "
@@ -292,10 +363,14 @@
}
# set variables for template
-set views_trend [counterTable Views [list seconds Second minutes Minute hours Hour]]
-set users_trend [counterTable Users [list user_count_minutes Minute user_count_hours Hour]]
-set response_trend [counterTable "Avg. Response Time" \
- [list response_time_minutes Minute response_time_hours Hour]]
+set views_trend [counterTable Views {seconds Second minutes Minute hours Hour}]
+set users_trend [counterTable {Users Authenticated} {
+ {user_count_minutes authenticated_count_minutes} Minute
+ {user_count_hours authenticated_count_hours} Hour
+}]
+set response_trend [counterTable "Avg. Response Time" {
+ response_time_minutes Minute response_time_hours Hour
+}]
set current_response [join [currentResponseTime] " "]
set current_load [currentSystemLoad]
|
|