Skip to content
Snippets Groups Projects
Commit 5d22f717 authored by Tibo's avatar Tibo
Browse files

check if delta < 0

parent 7f612b6a
No related branches found
No related tags found
No related merge requests found
......@@ -61,12 +61,20 @@ class Ifconfig extends AbstractSensor {
// RX
$delta = $interface->rx - $previous_value->rx;
if ($delta < 0) {
// Can happen after a reboot...
$delta = 0;
}
$dataset[$iname . "/RX"]["points"][] = new Point(
$interface->time * 1000,
round(8 / 1024 * $delta / $delta_time));
// TX
$delta = $interface->tx - $previous_value->tx;
if ($delta < 0) {
// Can happen after a reboot...
$delta = 0;
}
$dataset[$iname . "/TX"]["points"][] = new Point(
$interface->time * 1000,
round(8 / 1024 * $delta / $delta_time));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment