Code

pass fractional seconds upwards as floats
authorMatthias Bethke <mbe@financial.com>
Tue, 22 Nov 2016 16:37:33 +0000 (23:37 +0700)
committerMatthias Bethke <mbe@financial.com>
Tue, 22 Nov 2016 16:37:33 +0000 (23:37 +0700)
bindings/perl/lib/Collectd/Unixsock.pm

index 37f04cfe8c8f40148dce2606684a32c053b37eb5..96287eb4967f090ec6f9a4450ce20736fa2e9346 100644 (file)
@@ -404,10 +404,10 @@ sub listval_filter
                my ($time, $ident) = split / /, $msg, 2;
 
                $ident = _parse_identifier ($ident);
-               $ident->{time} = int $time;
+               $ident->{time} = 0+$time;
 
                push (@ret, $ident);
-       } # for (i = 0 .. $status)
+       } # for (i = 0 .. $nresults)
 
        return @ret;
 } # listval_filter
@@ -446,10 +446,10 @@ sub listval
                my ($time, $ident) = split / /, $msg, 2;
 
                $ident = _parse_identifier ($ident);
-               $ident->{time} = int $time;
+               $ident->{time} = 0+$time;
 
                push (@ret, $ident);
-       } # for (i = 0 .. $status)
+       } # for (i = 0 .. $nresults)
 
        return @ret;
 } # listval