aboutsummaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-23 20:04:24 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-23 20:04:24 +0200
commit8397e793cb95640b42b99f0ee41a7ee32b15adaa (patch)
treeadb7a1bad24c19255e0959becd662900bcc6dca2 /collectors
parent2b46011f06a3515dc7604059341ab9168fcfc508 (diff)
Tweak test-data and ping-intervals
Not _exactly_ dx16 data, but....
Diffstat (limited to 'collectors')
-rwxr-xr-xcollectors/ping.pl7
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;