diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-23 20:04:24 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-23 20:04:24 +0200 |
commit | 8397e793cb95640b42b99f0ee41a7ee32b15adaa (patch) | |
tree | adb7a1bad24c19255e0959becd662900bcc6dca2 /collectors | |
parent | 2b46011f06a3515dc7604059341ab9168fcfc508 (diff) |
Tweak test-data and ping-intervals
Not _exactly_ dx16 data, but....
Diffstat (limited to 'collectors')
-rwxr-xr-x | collectors/ping.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/collectors/ping.pl b/collectors/ping.pl index c1a4af3..d5acded 100755 --- a/collectors/ping.pl +++ b/collectors/ping.pl @@ -19,10 +19,13 @@ my $q = $dbh->prepare("SELECT switch,host(mgmt_v4_addr) as ip,host(mgmt_v6_addr) my $lq = $dbh->prepare("SELECT linknet,addr1,addr2 FROM linknets WHERE addr1 is not null and addr2 is not null;"); my $last = time(); -my $target = 1.0; +my $target = 0.2; while (1) { my $now = time(); - sleep($target - ($now - $last)); + my $elapsed = ($now - $last); + if ($elapsed < $target) { + sleep($target - ($now - $last)); + } $last = time(); # ping loopbacks my $ping = Net::Oping->new; |