From: Matthias Bethke Date: Tue, 22 Nov 2016 16:30:37 +0000 (+0700) Subject: update MockDaemon to report fractional seconds X-Git-Tag: collectd-5.7.0~28^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=88800275e0d8a968085234f5c03c68da71c221e0;p=collectd.git update MockDaemon to report fractional seconds --- diff --git a/bindings/perl/lib/Collectd/MockDaemon.pm b/bindings/perl/lib/Collectd/MockDaemon.pm index 381b2d17..abf058f6 100644 --- a/bindings/perl/lib/Collectd/MockDaemon.pm +++ b/bindings/perl/lib/Collectd/MockDaemon.pm @@ -55,9 +55,9 @@ sub daemon { } sub listval { - my $now = time; + my $trunc_now = substr(time, 0, -1); return print_nvalues(scalar @metrics) . - join('', map { "$now $_\n" } @metrics); + join('', map { sprintf("%s%d.%d %s\n", $trunc_now, rand(10), rand(1000), $_) } @metrics); } sub getval {