From 8522c869ff5da398ddc75a5260738e2b5947d4ea Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 16 Nov 2011 17:38:26 +0100 Subject: [PATCH] Bug 6015 : Test suite improvement follow-up * fixing use Strict errors * adding parameters and POD doc Signed-off-by: Chris Cormack --- misc/load_testing/benchmark_circulation.pl | 39 +++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 6 deletions(-) diff --git a/misc/load_testing/benchmark_circulation.pl b/misc/load_testing/benchmark_circulation.pl index 5a5f90d..717d83e 100755 --- a/misc/load_testing/benchmark_circulation.pl +++ b/misc/load_testing/benchmark_circulation.pl @@ -11,6 +11,7 @@ BEGIN { eval { require "$FindBin::Bin/kohalib.pl" }; } +use Getopt::Long; use HTTPD::Bench::ApacheBench; use LWP::UserAgent; use Data::Dumper; @@ -18,11 +19,37 @@ use HTTP::Cookies; use C4::Context; use C4::Debug; -my $baseurl= $ARGV[0] || "http://am123/cgi-bin/koha/"; -my $max_tries = 200; +my $help; +GetOptions( + 'help' => \$help, +); + +if ($help) { + print <execute; # calculate hits/sec print ("\t".$b2->total_time."ms\t".(1000*$b2->total_requests/$b2->total_time)." borrowers/sec\n"); -my $b2 = HTTPD::Bench::ApacheBench->new; +$b2 = HTTPD::Bench::ApacheBench->new; $b2->concurrency( $concurrency ); print "Load testing patron search page"; for (my $i=1;$i<=$max_tries;$i++) { @@ -154,7 +181,7 @@ $ro = $b2->execute; print ("\t".$b2->total_time."ms\t".(1000*$b2->total_requests/$b2->total_time)." borrowers/sec\n"); -my $b2 = HTTPD::Bench::ApacheBench->new; +$b2 = HTTPD::Bench::ApacheBench->new; $b2->concurrency( $concurrency ); print "Load testing patron search page"; -- 1.7.5.4