summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbuetow (lxpbuetow) <puppet@mx.buetow.org>2011-12-27 13:03:38 +0100
committerpbuetow (lxpbuetow) <puppet@mx.buetow.org>2011-12-27 13:03:38 +0100
commit898a11a5699f51873cb536d098c8894e415fac3c (patch)
tree06fd9535662dc18d89ecb58050674bd6838bb0d1
parentc1401ef97a7be25a80f61f20d41f29358a596959 (diff)
Bugfix
-rw-r--r--CHANGELOG2
-rwxr-xr-xloadbars3
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c50f79d..19a9163 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+* Bugfix: Max system+user pk is never >100%
+
Tue Dec 27 12:28:40 CET 2011
* Released v0.3.1
* --cluster option (which reads the ClusterSSH config file /etc/clusters/)
diff --git a/loadbars b/loadbars
index 3d9cc0f..0ec8b62 100755
--- a/loadbars
+++ b/loadbars
@@ -176,7 +176,7 @@ sub normalize_loads (%) {
sub get_cpuaverage ($@) {
my ($factor, @loads) = @_;
- my (%cpumax, %cpuaverage);
+ my (%cpumax, %cpuaverage);
for my $l (@loads) {
for (keys %$l) {
@@ -439,6 +439,7 @@ sub main_loop ($@) {
$rect_peak->y($C{height} - $maxheights{system} - $maxheights{user});
$max_system_n_user = sum @{$cpumax}{qw(user system)};
+ $max_system_n_user = 100 if $max_system_n_user > 100;
$app->fill($rect_peak, $max_system_n_user > Loadbars::USER_WHITE ? Loadbars::WHITE
: ($max_system_n_user > Loadbars::USER_RED ? Loadbars::RED