From e5602aad08db086a7063e6ded6f05dda417c9c47 Mon Sep 17 00:00:00 2001 From: "pbuetow (lxpbuetow)" Date: Tue, 27 Dec 2011 13:05:23 +0100 Subject: Bugfix --- CHANGELOG | 3 +++ loadbars | 5 +++-- 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 ', 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 -- cgit v1.2.3