X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Firspy.pl;h=3c80931bd9b02298b5d2b963441a36ca7b0479dd;hp=0e86dfd8d36b2a734e2099e5ed171ebcd4054756;hb=12a343206f9e3780db5fef1dbba84f9326064e15;hpb=535199e43854d67da9218973dd960d2027db5545 diff --git a/bin/irspy.pl b/bin/irspy.pl index 0e86dfd..3c80931 100755 --- a/bin/irspy.pl +++ b/bin/irspy.pl @@ -1,10 +1,12 @@ #!/usr/bin/perl -w -# $Id: irspy.pl,v 1.24 2007-02-27 15:01:40 mike Exp $ +# $Id: irspy.pl,v 1.27 2007-04-18 15:32:32 mike Exp $ # # Run like this: # YAZ_LOG=irspy,irspy_test IRSPY_SAVE_XML=1 perl -I../lib irspy.pl -t Quick localhost:8018/IR-Explain---1 z3950.loc.gov:7090/Voyager bagel.indexdata.dk/gils bagel.indexdata.dk:210/marc # YAZ_LOG=irspy,irspy_test sudo ./setrlimit -n 3000 -u mike -- perl -I../lib irspy.pl -t Main -a localhost:8018/IR-Explain---1 +# YAZ_LOG=irspy,irspy_test perl -I../lib irspy.pl -t Main -a -n 100 localhost:8018/IR-Explain---1 +# # Available log-levels are as follows: # irspy -- high-level application logging # irspy_debug -- low-level debugging (not very interesting) @@ -26,19 +28,20 @@ use Getopt::Std; use ZOOM::IRSpy::Web; use Carp; -local $SIG{__DIE__} = sub { +$SIG{__DIE__} = sub { my($msg) = @_; confess($msg); }; my %opts; -if (!getopts('wt:af:', \%opts) || @ARGV < 1) { +if (!getopts('wt:af:n:', \%opts) || @ARGV < 1) { print STDERR "\ Usage $0: [options] [ ...] -w Use ZOOM::IRSpy::Web subclass -t Run the specified [default: all tests] -a Test all targets (slow!) -f Test targets found by the specified query + -n Number of connection to keep in active set "; exit 1; } @@ -47,7 +50,7 @@ my($dbname, @targets) = @ARGV; my $class = "ZOOM::IRSpy"; $class .= "::Web" if $opts{w}; -my $spy = $class->new($dbname, "admin", "fruitbat"); +my $spy = $class->new($dbname, "admin", "fruitbat", $opts{n}); if (@targets) { $spy->targets(@targets); } elsif ($opts{f}) { @@ -57,8 +60,8 @@ if (@targets) { exit 1; } -$spy->initialise(); -my $res = $spy->check($opts{t}); +$spy->initialise($opts{t}); +my $res = $spy->check(); if ($res == 0) { print "All tests were attempted\n"; } else {