1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
19 print STDERR
"================ Single-threaded (default) Latency Test\n";
23 for ($i = 0; $i <= $#ARGV; $i++) {
24 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
25 print "Run_Test Perl script for Performance Test\n\n";
26 print "run_test [-t type] \n";
28 print "-t type -- runs only one type of param test\n";
31 elsif ($ARGV[$i] eq "-t") {
32 $type = $ARGV[$i + 1];
37 my $iterations = 150000;
39 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
40 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
42 my $iorbase = "test.ior";
43 my $defaultconf = "default$PerlACE::svcconf_ext";
44 my $server_defaultconf = $server->LocalFile ($defaultconf);
45 my $client_defaultconf = $client->LocalFile ($defaultconf);
46 my $server_iorfile = $server->LocalFile ($iorbase);
47 my $client_iorfile = $client->LocalFile ($iorbase);
48 $server->DeleteFile($iorbase);
49 $client->DeleteFile($iorbase);
51 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile ".
52 "-ORBSvcConf $server_defaultconf");
53 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile -t $type -i $iterations ".
54 "-ORBSvcConf $client_defaultconf");
56 print STDERR
$CL->CommandLine () ;
57 $server_status = $SV->Spawn ();
59 if ($server_status != 0) {
60 print STDERR
"ERROR: server returned $server_status\n";
64 if ($server->WaitForFileTimed ($iorbase,
65 $server->ProcessStartWaitInterval()) == -1) {
66 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
71 if ($server->GetFile ($iorbase) == -1) {
72 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
77 if ($client->PutFile ($iorbase) == -1) {
78 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
79 $SV->Kill (); $SV->TimedWait (1);
83 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
85 if ($client_status != 0) {
86 print STDERR
"ERROR: client returned $client_status\n";
90 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
92 if ($server_status != 0) {
93 print STDERR
"ERROR: server returned $server_status\n";
97 $server->DeleteFile($iorbase);
98 $client->DeleteFile($iorbase);