2 use lib '/openils/lib/perl5/';
4 use OpenILS::Application::AppUtils;
6 use OpenSRF::EX qw/:try/;
9 use OpenILS::Utils::Fieldmapper;
10 use Digest::MD5 qw/md5_hex/;
11 use OpenSRF::Utils qw/:daemon/;
12 use OpenSRF::MultiSession;
13 use OpenSRF::AppSession;
14 use Time::HiRes qw/time/;
20 die "Gimme a config file!!!";
22 OpenSRF::System->bootstrap_client( config_file => $config );
25 @ARGV = ('open-ils.storage','opensrf.system.echo');
34 my $mses = OpenSRF::MultiSession->new( app => $app, cap => 10, api_level => 1 );
36 $mses->success_handler(
40 print $req->{params}->[0] . "\t: " . JSON->perl2JSON($req->{response}->[0]->content)."\n";
44 $mses->failure_handler(
48 warn "record $req->{params}->[0] failed: ".JSON->perl2JSON($req->{response});
56 $overhead = $start - $overhead;
59 $mses->request( @ARGV,$_ );
61 $mses->session_wait(1);
66 my @c = $mses->completed;
67 my @f = $mses->failed;
70 $x += $_->{duration} for (@c);
72 print "\n". '-'x40 . "\n";
73 print "Startup Overhead: ".sprintf('%0.3f',$overhead)."s\n";
74 print "Completed Commands: ".@c."\n";
75 print "Failed Commands: ".@f."\n";
76 print "Serial Run Time: ".sprintf('%0.3f',$x)."s\n";
77 print "Serial Avg Time: ".sprintf('%0.3f',$x/$count)."s\n";
78 print "Total Run Time: ".sprintf('%0.3f',$end-$start)."s\n";
79 print "Total Avg Time: ".sprintf('%0.3f',($end-$start)/$count)."s\n";