mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-07 03:20:11 +00:00
sort module usage + some newlines for readabilty
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
1f929ade0a
commit
f27d5e6b7a
@ -2,15 +2,16 @@ package PVE::Network;
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use PVE::Tools qw(run_command lock_file);
|
|
||||||
use PVE::ProcFSTools;
|
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
|
use PVE::ProcFSTools;
|
||||||
|
use PVE::Tools qw(run_command lock_file);
|
||||||
|
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use IO::Socket::IP;
|
use IO::Socket::IP;
|
||||||
use Socket qw(NI_NUMERICHOST NI_NUMERICSERV);
|
|
||||||
use POSIX qw(ECONNREFUSED);
|
|
||||||
|
|
||||||
use Net::IP;
|
use Net::IP;
|
||||||
|
use POSIX qw(ECONNREFUSED);
|
||||||
|
use Socket qw(NI_NUMERICHOST NI_NUMERICSERV);
|
||||||
|
|
||||||
# host network related utility functions
|
# host network related utility functions
|
||||||
|
|
||||||
|
@ -147,9 +147,11 @@ sub read_proc_stat {
|
|||||||
my $useddiff = $res->{used} - $last_proc_stat->{used};
|
my $useddiff = $res->{used} - $last_proc_stat->{used};
|
||||||
$useddiff = $diff if $useddiff > $diff;
|
$useddiff = $diff if $useddiff > $diff;
|
||||||
$res->{cpu} = $useddiff/$diff;
|
$res->{cpu} = $useddiff/$diff;
|
||||||
|
|
||||||
my $waitdiff = $res->{iowait} - $last_proc_stat->{iowait};
|
my $waitdiff = $res->{iowait} - $last_proc_stat->{iowait};
|
||||||
$waitdiff = $diff if $waitdiff > $diff;
|
$waitdiff = $diff if $waitdiff > $diff;
|
||||||
$res->{wait} = $waitdiff/$diff;
|
$res->{wait} = $waitdiff/$diff;
|
||||||
|
|
||||||
$last_proc_stat = $res;
|
$last_proc_stat = $res;
|
||||||
} else {
|
} else {
|
||||||
$res->{cpu} = $last_proc_stat->{cpu};
|
$res->{cpu} = $last_proc_stat->{cpu};
|
||||||
|
Loading…
Reference in New Issue
Block a user