sub listval {
my $trunc_now = substr(time, 0, -1);
+ my $toggle;
return print_nvalues(scalar @metrics) .
- join('', map { sprintf("%s%d.%d %s\n", $trunc_now, rand(10), rand(1000), $_) } @metrics);
+ join('', map { $trunc_now . int(rand(10)) . ($toggle=!$toggle ? ".".int(rand(1000)) : '') . " $_\n" } @metrics);
}
sub getval {
(exists $args{plugin_instance} ? "-$args{plugin_instance}" : '(?:-[^/]+)?') .
(exists $args{type} ? "/$args{type}" : '/[^/-]+') .
(exists $args{type_instance} ? "-$args{type_instance}" : '(?:-[^/]+)?');
- $pattern = qr/^\d+\.\d+ $pattern$/;
+ $pattern = qr/^\d+(?:\.\d+)? $pattern$/;
my $msg = $self->_socket_command('LISTVAL') or return;
($nresults, $msg) = split / /, $msg, 2;