2 use lib '@libdir@/perl5/';
4 use OpenILS::Application::AppUtils;
6 use OpenSRF::EX qw/:try/;
7 use OpenSRF::Utils::JSON;
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/;
19 die "Gimme a config file!!!";
21 OpenSRF::System->bootstrap_client( config_file => $config );
24 @ARGV = ('open-ils.storage','opensrf.system.echo');
33 my $mses = OpenSRF::MultiSession->new( app => $app, cap => 10, api_level => 1 );
35 $mses->success_handler(
39 print $req->{params}->[0] . "\t: " . OpenSRF::Utils::JSON->perl2JSON($req->{response}->[0]->content)."\n";
43 $mses->failure_handler(
47 warn "record $req->{params}->[0] failed: " . OpenSRF::Utils::JSON->perl2JSON($req->{response});
55 $overhead = $start - $overhead;
58 $mses->request( @ARGV,$_ );
60 $mses->session_wait(1);
65 my @c = $mses->completed;
66 my @f = $mses->failed;
69 $x += $_->{duration} for (@c);
71 print "\n". '-'x40 . "\n";
72 print "Startup Overhead: ".sprintf('%0.3f',$overhead)."s\n";
73 print "Completed Commands: ".@c."\n";
74 print "Failed Commands: ".@f."\n";
75 print "Serial Run Time: ".sprintf('%0.3f',$x)."s\n";
76 print "Serial Avg Time: ".sprintf('%0.3f',$x/$count)."s\n";
77 print "Total Run Time: ".sprintf('%0.3f',$end-$start)."s\n";
78 print "Total Avg Time: ".sprintf('%0.3f',($end-$start)/$count)."s\n";