summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbuetow (lxpbuetow) <puppet@mx.buetow.org>2011-12-27 13:05:23 +0100
committerpbuetow (lxpbuetow) <puppet@mx.buetow.org>2011-12-27 13:05:23 +0100
commite5602aad08db086a7063e6ded6f05dda417c9c47 (patch)
treecefbd6f4646efe0ee9f4ceeae076bd612d30518a
parent7003029f282fcfc0e302bfd1ce2def3a7aef5b8f (diff)
Bugfix
-rw-r--r--CHANGELOG3
-rwxr-xr-xloadbars5
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c50f79d..3c436c6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Tue Dec 27 13:04:43 CET 2011
+* Bugfix: Max system+user peak 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 1995bb0..ad4f371 100755
--- a/loadbars
+++ b/loadbars
@@ -26,7 +26,7 @@ use threads::shared;
use constant {
DEPTH => 8,
- VERSION => 'loadbars v0.3.1',
+ VERSION => 'loadbars v0.3.1-devel',
Copyright => '2010-2011 (c) Paul Buetow <loadbars@mx.buetow.org>',
CSSH_CONFFILE => '/etc/clusters',
CSSH_MAX_RECURSION => 10,
@@ -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