Show collected CPU averages

This commit is contained in:
Jamie Cameron
2010-02-24 18:24:55 -08:00
parent be48af6a84
commit daabfb13c2
2 changed files with 14 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ right_cpu=CPU load averages
right_cpuinfo=Processor information
right_cputype=$5, $8 cores
right_load=$1 (1 min) $2 (5 mins) $3 (15 mins)
right_cpuuse=CPU usage
right_cpustats=$1% user, $2% kernel, $4% IO, $3% idle
right_real=Real memory
right_virt=Virtual memory
right_procs=Running processes

View File

@@ -107,13 +107,24 @@ if ($level == 0) {
print "<td>$pr</td> </tr>\n";
}
# Load and memory info
# Load averages
if ($info->{'load'}) {
@c = @{$info->{'load'}};
if (@c) {
print "<tr> <td><b>$text{'right_cpu'}</b></td>\n";
print "<td>",&text('right_load', @c),"</td> </tr>\n";
}
}
# CPU usage
if ($info->{'cpu'}) {
@c = @{$info->{'cpu'}};
print "<tr> <td><b>$text{'right_cpuuse'}</b></td>\n";
print "<td>",&text('right_cpustats', @c),"</td> </tr>\n";
}
# Memory usage
if ($info->{'mem'}) {
@m = @{$info->{'mem'}};
if (@m && $m[0]) {
print "<tr> <td><b>$text{'right_real'}</b></td>\n";