Annotation of loncom/debugging_tools/stress.pl, revision 1.1

1.1     ! albertel    1: #usage is perl stress.pl <number of clients to create>
        !             2: use strict;
        !             3: use lib '/home/httpd/lib/perl/';
        !             4: use LONCAPA::Configuration;
        !             5: use Apache::lonnet;
        !             6: 
        !             7: my $perlvar=&LONCAPA::Configuration::read_conf('loncapa.conf');
        !             8: my $server=$perlvar->{'lonHostID'};
        !             9: 
        !            10: my %requests = 
        !            11:     (
        !            12:      'ping' => $server
        !            13:      );
        !            14: 
        !            15: my $number=$ARGV[0];
        !            16: 
        !            17: while ($number--) {
        !            18:     my $pid=fork;
        !            19:     if (!$pid) { last; }
        !            20: }
        !            21: while(1) {
        !            22:     while (my($cmd,$resp)=each(%requests)) {
        !            23: 	my $result=&Apache::lonnet::reply($cmd,$server);
        !            24: 	if ($result ne $resp) {
        !            25: 	    print ("FAILED: $result\n");
        !            26: 	}
        !            27:     }
        !            28: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>