[LON-CAPA-cvs] cvs: loncom /debugging_tools stress.pl

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 20 Sep 2004 18:33:14 -0000


albertel		Mon Sep 20 14:33:14 2004 EDT

  Added files:                 
    /loncom/debugging_tools	stress.pl 
  Log:
  - simple lonc-> lond stress test
  
  

Index: loncom/debugging_tools/stress.pl
+++ loncom/debugging_tools/stress.pl
#usage is perl stress.pl <number of clients to create>
use strict;
use lib '/home/httpd/lib/perl/';
use LONCAPA::Configuration;
use Apache::lonnet;

my $perlvar=&LONCAPA::Configuration::read_conf('loncapa.conf');
my $server=$perlvar->{'lonHostID'};

my %requests = 
    (
     'ping' => $server
     );

my $number=$ARGV[0];

while ($number--) {
    my $pid=fork;
    if (!$pid) { last; }
}
while(1) {
    while (my($cmd,$resp)=each(%requests)) {
	my $result=&Apache::lonnet::reply($cmd,$server);
	if ($result ne $resp) {
	    print ("FAILED: $result\n");
	}
    }
}