fix(netdata): mode traffic - no speed value (#3285)

This commit is contained in:
qgarnier 2021-12-01 11:01:30 +01:00 committed by GitHub
parent 71957e883e
commit 3a89dc62e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -114,12 +114,14 @@ sub manage_selection {
$count++;
}
my $speed = defined($int->{speed}) ? $int->{speed} * 1000 * 1000 : '';
$speed = $self->{option_results}->{speed}
if (defined($self->{option_results}->{speed}) && $self->{option_results}->{speed} ne '');
$self->{interfaces}->{ $int->{name} } = {
display => $int->{name},
traffic_in => $metrics->{received} * 1000,
traffic_out => $metrics->{sent} * 1000,
speed => defined($self->{option_results}->{speed}) && $self->{option_results}->{speed} ne '' ?
$self->{option_results}->{speed} : $int->{speed} * 1000 * 1000
speed => $speed
};
}