From 88800275e0d8a968085234f5c03c68da71c221e0 Mon Sep 17 00:00:00 2001 From: Matthias Bethke Date: Tue, 22 Nov 2016 23:30:37 +0700 Subject: [PATCH] update MockDaemon to report fractional seconds --- bindings/perl/lib/Collectd/MockDaemon.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.11.0