+ "
+
+ foreach p [lsort [ns_info pools]] {
+ append html "\
+ [lindex $p 0]:
+
+
+
+
+
+
+ Block Size |
+ Frees |
+ Gets |
+ Puts |
+ Bytes Req |
+ Bytes Used |
+ Overhead |
+ Locks |
+ Lock Waits |
+ "
+
+ foreach b [lrange $p 1 end] {
+ set bs [lindex $b 0]
+ set nf [lindex $b 1]
+ set ng [lindex $b 2]
+ set np [lindex $b 3]
+ set nr [lindex $b 4]
+ set nu [expr $ng - $np]
+ set na [expr $nu * $bs]
+
+ incr tops [expr $ng + $np]
+ incr tlocks [lindex $b 5]
+ incr twaits [lindex $b 6]
+ incr tfree [expr $bs * $nf]
+ incr talloc $na
+ incr trequest $nr
+ incr tused $nu
+
+ if {$nr != 0} {
+ set ov [expr $na - $nr]
+ set op [format %4.2f%% [expr $ov.0 * 100 / $nr.0]]
+ } else {
+ set ov "N/A"
+ set op "N/A"
+ }
+
+ append html ""
+
+ foreach e [linsert [lreplace $b 4 4] 4 $nr $na $op] {
+ append html "$e | "
+ }
+
+ append html " "
+ }
+
+ append html "\
+
+ |
+
+
+ "
+ }
+
+ set ov [expr $talloc - $trequest]
+ set op [format %4.2f [expr $ov.0 * 100 / $trequest.0]]
+ set av [format %4.2f [expr 100.0 - ($tlocks.0 * 100) / $tops.0]]
+
+ if {$tlocks > 0} {
+ set wr [format %4.2f [expr $twaits.0 / $tlocks.0]]
+ } else {
+ set wr N/A
+ }
+
+ append html "\
+ |
+
+