3 use OpenILS::Application::AppUtils;
5 use OpenSRF::EX qw/:try/;
6 use OpenSRF::Utils::JSON;
8 use OpenILS::Utils::Fieldmapper;
9 use Digest::MD5 qw/md5_hex/;
10 use OpenSRF::Utils qw/:daemon/;
11 use OpenSRF::MultiSession;
12 use OpenSRF::AppSession;
13 use Time::HiRes qw/time/;
18 die "Gimme a config file!!!";
20 OpenSRF::System->bootstrap_client( config_file => $config );
23 @ARGV = ('open-ils.storage','opensrf.system.echo');
32 my $mses = OpenSRF::MultiSession->new( app => $app, cap => 10, api_level => 1 );
34 $mses->success_handler(
38 print $req->{params}->[0] . "\t: " . OpenSRF::Utils::JSON->perl2JSON($req->{response}->[0]->content)."\n";
42 $mses->failure_handler(
46 warn "record $req->{params}->[0] failed: " . OpenSRF::Utils::JSON->perl2JSON($req->{response});
54 $overhead = $start - $overhead;
57 $mses->request( @ARGV,$_ );
59 $mses->session_wait(1);
64 my @c = $mses->completed;
65 my @f = $mses->failed;
68 $x += $_->{duration} for (@c);
70 print "\n". '-'x40 . "\n";
71 print "Startup Overhead: ".sprintf('%0.3f',$overhead)."s\n";
72 print "Completed Commands: ".@c."\n";
73 print "Failed Commands: ".@f."\n";
74 print "Serial Run Time: ".sprintf('%0.3f',$x)."s\n";
75 print "Serial Avg Time: ".sprintf('%0.3f',$x/$count)."s\n";
76 print "Total Run Time: ".sprintf('%0.3f',$end-$start)."s\n";
77 print "Total Avg Time: ".sprintf('%0.3f',($end-$start)/$count)."s\n";