5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-03-08 08:58:43 +03:00

sort module usage + some newlines for readabilty

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-01-08 10:31:39 +01:00
parent 1f929ade0a
commit f27d5e6b7a
2 changed files with 8 additions and 5 deletions

View File

@ -2,15 +2,16 @@ package PVE::Network;
use strict;
use warnings;
use PVE::Tools qw(run_command lock_file);
use PVE::ProcFSTools;
use PVE::INotify;
use PVE::ProcFSTools;
use PVE::Tools qw(run_command lock_file);
use File::Basename;
use IO::Socket::IP;
use Socket qw(NI_NUMERICHOST NI_NUMERICSERV);
use POSIX qw(ECONNREFUSED);
use Net::IP;
use POSIX qw(ECONNREFUSED);
use Socket qw(NI_NUMERICHOST NI_NUMERICSERV);
# host network related utility functions

View File

@ -147,9 +147,11 @@ sub read_proc_stat {
my $useddiff = $res->{used} - $last_proc_stat->{used};
$useddiff = $diff if $useddiff > $diff;
$res->{cpu} = $useddiff/$diff;
my $waitdiff = $res->{iowait} - $last_proc_stat->{iowait};
$waitdiff = $diff if $waitdiff > $diff;
$res->{wait} = $waitdiff/$diff;
$last_proc_stat = $res;
} else {
$res->{cpu} = $last_proc_stat->{cpu};