summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-02-09 09:46:05 +0100
committerPaul Buetow <paul@buetow.org>2012-02-09 09:46:05 +0100
commite7c79b0dc016ab9b8df9d748009cf752c14de9cd (patch)
treeb7ac3943e31a162b9f7ac24d9fe9adff08fd51c0
parentcf9b6889ae250ad70a3d55fffd9b4e25d2cce3aa (diff)
some minor stuff
-rw-r--r--WISHLIST2
-rwxr-xr-xloadbars28
2 files changed, 16 insertions, 14 deletions
diff --git a/WISHLIST b/WISHLIST
index c494f6c..ea234ff 100644
--- a/WISHLIST
+++ b/WISHLIST
@@ -2,3 +2,5 @@
* Stats for network
* .deb for Debian and Ubuntu
* Auto detect single core boxes
+* Make code modular (script is growing...)
+* Optimize code (too much cpu usage if there are too many hosts involved)
diff --git a/loadbars b/loadbars
index 9edd0c1..14e5a0d 100755
--- a/loadbars
+++ b/loadbars
@@ -522,15 +522,15 @@ sub main_loop ($@) {
my $rect_separator = undef;
- my $rect_idle = get_rect $rects, "$key;idle";
- my $rect_steal = get_rect $rects, "$key;steal";
- my $rect_guest = get_rect $rects, "$key;guest";
- my $rect_irq = get_rect $rects, "$key;irq";
+ my $rect_idle = get_rect $rects, "$key;idle";
+ my $rect_steal = get_rect $rects, "$key;steal";
+ my $rect_guest = get_rect $rects, "$key;guest";
+ my $rect_irq = get_rect $rects, "$key;irq";
my $rect_softirq = get_rect $rects, "$key;softirq";
- my $rect_nice = get_rect $rects, "$key;nice";
- my $rect_iowait = get_rect $rects, "$key;iowait";
- my $rect_user = get_rect $rects, "$key;user";
- my $rect_system = get_rect $rects, "$key;system";
+ my $rect_nice = get_rect $rects, "$key;nice";
+ my $rect_iowait = get_rect $rects, "$key;iowait";
+ my $rect_user = get_rect $rects, "$key;user";
+ my $rect_system = get_rect $rects, "$key;system";
my $rect_peak;
@@ -765,14 +765,14 @@ sub main_loop ($@) {
if ( INTERVAL > $t_diff ) {
usleep 10000;
- # Goto is OK if you don't produce spaghetti code
+ # Goto is OK as long you don't produce spaghetti code
goto TIMEKEEPER;
} elsif ( INTERVAL_WARN < $t_diff ) {
display_warn "WARN: Loop is behind $t_diff seconds, your computer may be too slow";
}
- $t1 = $t2;
+ $t1 = $t2;
$event_handler->();
my $new_num_stats = keys %CPUSTATS;
@@ -856,10 +856,10 @@ Examples:
loadbars --cluster foocluster (foocluster is in /etc/clusters [ClusterSSH])
END
- # mode 1: Option is shown in the online help menu (stdout not sdl)
- # mode 2: Option is shown in the 'usage' screen from the command line
- # mode 4: Option is used to generate the GetOptions parameters for Getopt::Long
- # Combinations: Like chmod(1)
+ # mode 1: Option is shown in the online help menu (stdout not sdl)
+ # mode 2: Option is shown in the 'usage' screen from the command line
+ # mode 4: Option is used to generate the GetOptions parameters for Getopt::Long
+ # Combinations: Like chmod(1)
my %d = (
average => {