(plugin) os::linux::local - mode cpu wrong calculation (#3694)
This commit is contained in:
parent
304d360273
commit
884380d71a
|
@ -39,7 +39,7 @@ sub custom_cpu_avg_calc {
|
|||
$buffer = 0;
|
||||
|
||||
my ($old_total, $old_cpu_idle) = (0, 0);
|
||||
if ($options{new_datas}->{$_} > $options{old_datas}->{$_}) {
|
||||
if ($options{new_datas}->{$_} >= $options{old_datas}->{$_}) {
|
||||
$old_total = $options{old_datas}->{$_} + $options{old_datas}->{$prefix . '_system'} +
|
||||
$options{old_datas}->{$prefix . '_user'} + $options{old_datas}->{$prefix . '_iowait'};
|
||||
$old_cpu_idle = $options{old_datas}->{$_};
|
||||
|
@ -72,7 +72,7 @@ sub custom_cpu_core_calc {
|
|||
my ($self, %options) = @_;
|
||||
|
||||
my ($old_total, $old_cpu_idle) = (0, 0);
|
||||
if ($options{new_datas}->{$self->{instance} . '_idle'} > $options{old_datas}->{$self->{instance} . '_idle'}) {
|
||||
if ($options{new_datas}->{$self->{instance} . '_idle'} >= $options{old_datas}->{$self->{instance} . '_idle'}) {
|
||||
$old_total = $options{old_datas}->{$self->{instance} . '_idle'} + $options{old_datas}->{$self->{instance} . '_system'} +
|
||||
$options{old_datas}->{$self->{instance} . '_user'} + $options{old_datas}->{$self->{instance} . '_iowait'};
|
||||
$old_cpu_idle = $options{old_datas}->{$self->{instance} . '_idle'};
|
||||
|
|
Loading…
Reference in New Issue