Tool::Bench::Report::JSON;
{
$Tool::Bench::Report::JSON::VERSION = '0.003';
}
use Mouse;
use JSON;
use List::Util qw{min max sum };
use Data::Dumper;
=head1 JSON
Builds a json report as follows (
n_time max_time total_time avg_time total_runs name note times }; #this is kinda janky
encode_json( [ map { my $item = $_;
my $x =
{ (
format => 'Text'); # uses Tool::Bench::Report::Text
$bench->report(format => 'JSON'); # uses Tool::Bench::Report::JSON
By using class names you can build your own report simply, see
L<Tool::Bench:
' --file 't/01-works.t' --count 3 --format JSON
=head1 TODO
needs docs
=cut
die qx{perldoc $0} unless @ARGV;
my ($count,$format,$interp,$file) = (1,'JSON'); #supply defaults;
my $opt = GetOptions
=> sub{$naptime = rand(10)},
teardown => sub{$naptime = 1},
},
);
$bench->run(3);
print $bench->report(format => 'JSON');