diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-25 00:30:43 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-25 00:30:43 +0000 |
commit | 9888c479c372e0b2ad1f0ff417d54bebb7b353b5 (patch) | |
tree | b680676d671219cb6691b4ea63c99569ae3f4d36 | |
parent | 81de2fd349f63ff63d62df35c10339181f2a62fe (diff) | |
download | ATCD-9888c479c372e0b2ad1f0ff417d54bebb7b353b5.tar.gz |
ChangeLogTag:Tue Aug 24 19:09:20 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-99c | 15 | ||||
-rw-r--r-- | TAO/performance-tests/Latency/Makefile | 9 | ||||
-rw-r--r-- | TAO/performance-tests/Latency/TestImpl.java | 17 | ||||
-rw-r--r-- | TAO/performance-tests/Latency/client.cpp | 21 | ||||
-rw-r--r-- | TAO/performance-tests/Latency/java_client.java | 38 | ||||
-rw-r--r-- | TAO/performance-tests/Latency/java_server.java | 43 |
6 files changed, 131 insertions, 12 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 3a7ec2c9ee8..3e496c48a62 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,18 @@ +Tue Aug 24 19:09:20 1999 Carlos O'Ryan <coryan@cs.wustl.edu> + + * performance-tests/Latency/client.cpp: + The user can specify a period for all the threads, in + milliseconds, the option is now consistent with the st_client + test + + * performance-tests/Latency/Makefile: + * performance-tests/Latency/TestImpl.java: + * performance-tests/Latency/java_client.java: + * performance-tests/Latency/java_server.java: + Added a Java version of the latency test, we should move it to + some other place (like a separate VisiJava directory), but not + right now. + Tue Aug 24 18:14:01 1999 Jeff Parsons <parsons@cs.wustl.edu> * TAO_IDL/be/be_visitor_enum/enum_ch.cpp: diff --git a/TAO/performance-tests/Latency/Makefile b/TAO/performance-tests/Latency/Makefile index 86c4322be2a..da05a2cf6d0 100644 --- a/TAO/performance-tests/Latency/Makefile +++ b/TAO/performance-tests/Latency/Makefile @@ -80,6 +80,15 @@ ami-throughput-client: $(addprefix $(VDIR),$(AMI_THROUGHPUT_CLIENT_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) endif # AMI +Test.java: test.idl + idl2java test.idl + +java_client.class: Test.java + vbjc java_client.java + +java_server.class: + vbjc java_server.java + realclean: clean -$(RM) $(foreach ext, $(IDL_EXT), test$(ext)) diff --git a/TAO/performance-tests/Latency/TestImpl.java b/TAO/performance-tests/Latency/TestImpl.java new file mode 100644 index 00000000000..b494c3cd56e --- /dev/null +++ b/TAO/performance-tests/Latency/TestImpl.java @@ -0,0 +1,17 @@ +// +// $Id$ +// + +public class TestImpl extends _TestImplBase { + public TestImpl (org.omg.CORBA.ORB orb) { + orb_ = orb; + } + public long test_method(long stamp) { + return stamp; + } + public void shutdown () { + orb_.shutdown (); + } + + private org.omg.CORBA.ORB orb_; +} diff --git a/TAO/performance-tests/Latency/client.cpp b/TAO/performance-tests/Latency/client.cpp index f4cae9a5c3d..8acd6e47ce2 100644 --- a/TAO/performance-tests/Latency/client.cpp +++ b/TAO/performance-tests/Latency/client.cpp @@ -12,15 +12,12 @@ ACE_RCSID(Latency, client, "$Id$") const char *ior = "file://test.ior"; int nthreads = 5; int niterations = 5; - -int sleep_flag = 0; - -ACE_Time_Value sleep_time (0, 10000); +int period = -1; int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:n:i:s"); + ACE_Get_Opt get_opts (argc, argv, "k:n:i:p:"); int c; while ((c = get_opts ()) != -1) @@ -35,8 +32,8 @@ parse_args (int argc, char *argv[]) case 'i': niterations = ACE_OS::atoi (get_opts.optarg); break; - case 's': - sleep_flag = 1; + case 'p': + period = ACE_OS::atoi (get_opts.optarg); break; case '?': default: @@ -227,13 +224,13 @@ Client::svc (void) ACE_TRY_CHECK; - // Sleep for 10 msecs. - if (sleep_flag) - ACE_OS::sleep (sleep_time); - - if (TAO_debug_level > 0 && i % 100 == 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); + if (period != -1) + { + ACE_Time_Value tv (0, period * 1000); + ACE_OS::sleep (tv); + } } } ACE_CATCHANY diff --git a/TAO/performance-tests/Latency/java_client.java b/TAO/performance-tests/Latency/java_client.java new file mode 100644 index 00000000000..09c55654d9d --- /dev/null +++ b/TAO/performance-tests/Latency/java_client.java @@ -0,0 +1,38 @@ +// +// $Id$ +// + +import java.io.*; + +public class java_client { + + public static void main(String[] args) { + // Initialize the ORB. + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); + + // Read the AccountManager's IOR from a file + Test test = null; + try { + LineNumberReader input = + new LineNumberReader(new FileReader("test.ior")); + org.omg.CORBA.Object object = orb.string_to_object(input.readLine()); + test = TestHelper.narrow(object); + } + catch(java.io.IOException e) { + System.out.println("Exception: " + e); + System.exit(1); + } + + // use args[0] as the number of iterations. + Long value = new Long (args.length > 0 ? args[0] : "10000"); + + long iterations = value.longValue (); + + // Request the account manager to open a named account. + for (int i = 0; i != iterations; ++i) { + test.test_method (0); + } + test.shutdown (); + } + +} diff --git a/TAO/performance-tests/Latency/java_server.java b/TAO/performance-tests/Latency/java_server.java new file mode 100644 index 00000000000..6bc02c99744 --- /dev/null +++ b/TAO/performance-tests/Latency/java_server.java @@ -0,0 +1,43 @@ +// +// $Id$ + +import java.io.*; + +public class java_server { + + public static void main(String[] args) { + // Initialize the ORB. + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); + + Test test = new TestImpl (orb); + + // Export the newly create object. + orb.connect(test); + + // Write the IOR to a file + try { + FileWriter output = new FileWriter("test.ior"); + output.write(orb.object_to_string(test)); + output.close(); + } + catch(java.io.IOException e) { + System.out.println("Exception: " + e); + System.exit(1); + } + + System.out.println("The IOR is <" + + orb.object_to_string(test) + + ">"); + + orb.run (); + + /* + Thread.currentThread().join(); + } + catch(InterruptedException e) { + System.out.println(e); + } + */ + } + +} |