summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c812ac6)
voltage regulators reporting in iio are example
my $influx_url = shift @ARGV || 'http://10.13.37.92:8086/write?consistency=any&db=rot13';
my $influx_url = shift @ARGV || 'http://10.13.37.92:8086/write?consistency=any&db=rot13';
+my $delay = $ENV{DELAY} || 1;
+
my $hostname = `hostname -s`;
chomp($hostname);
my $hostname = `hostname -s`;
chomp($hostname);
if ( $influx =~ m/,$/ ) {
$influx =~ s/,$/ $t_influx\n/;
if ( $influx =~ m/,$/ ) {
$influx =~ s/,$/ $t_influx\n/;
+ } elsif ( $influx =~ m/ $/ ) { # only device
+ $influx =~ s/\S+\s$//;
}
$influx .= "iio,dc=trnjanska,host=$hostname,device=$device ";
}
$influx .= "iio,dc=trnjanska,host=$hostname,device=$device ";
system "curl --silent -XPOST '$influx_url' --data-binary '$influx'";
warn "$influx\n";
system "curl --silent -XPOST '$influx_url' --data-binary '$influx'";
warn "$influx\n";
- sleep Time::HiRes::time + 1 - $t;
+ sleep Time::HiRes::time + $delay - $t;