Skip to content

Commit

Permalink
fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Apr 13, 2018
1 parent 435d3d5 commit 7cc29e4
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/Smokeping/probes/IRTT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -475,22 +475,26 @@ sub pingone ($$) {
my $ns;
my $dl = $rt->{'delay'};
my $pv = $rt->{'ipdv'};
switch ($tv->{metric}) {
case /^(rtt|send|receive)$/ {
for ($tv->{metric}) {
/^(rtt|send|receive)$/ && do {
$ns = $dl->{$tv->{metric}};
if ($ns < 0) {
$ns = 0;
}
}
case "ipdv" {
next;
};
/^ipdv$/ && do {
$ns = $pv->{'rtt'};
}
case "send_ipdv" {
next;
};
/^send_ipdv$/ && do {
$ns = $pv->{'send'};
}
case "receive_ipdv" {
next;
};
/^receive_ipdv$/ && do {
$ns = $pv->{'receive'};
}
next;
};
die("ERROR: impossible metric $tv->{metric}")
}
push @times, nstos(abs($ns)) if looks_like_number($ns);
Expand Down

0 comments on commit 7cc29e4

Please sign in to comment.