mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-23 05:07:54 +00:00
Load avg on BSD:
Michał Markowski says: "uptime" output on OpenBSD and FreeBSD (so probably NetBSD and DragonflyBSD too) look similar to this: 2:22PM up 30 days, 13:44, 1 user, load averages: 0.06, 0.09, 0.13
This commit is contained in:
parent
9e90477393
commit
00a2b4d119
|
@ -569,7 +569,7 @@ sub load_status_linux {
|
|||
close IN;
|
||||
} elsif (open(IN,"uptime|")) {
|
||||
my $upString = <IN>;
|
||||
if($upString =~ m/average.\s*(\d+\.\d+)/) {
|
||||
if($upString =~ m/averages?.\s*(\d+\.\d+)/) {
|
||||
$loadavg = $1;
|
||||
} else {
|
||||
::die_bug("uptime");
|
||||
|
|
|
@ -2395,7 +2395,7 @@ sub loadavg {
|
|||
my $uptime_out = <$uptime_fh>;
|
||||
close $uptime_fh;
|
||||
# load average: 0.76, 1.53, 1.45
|
||||
if($uptime_out =~ /load average: (\d+.\d+)/) {
|
||||
if($uptime_out =~ /load averages?: (\d+.\d+)/) {
|
||||
$self->{'loadavg'} = $1;
|
||||
::debug("New loadavg: ".$self->{'loadavg'});
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue