[jboss-cvs] JBossAS SVN: r68488 - projects/cluster/varia/sessionstress.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Dec 21 04:40:12 EST 2007


Author: bela at jboss.com
Date: 2007-12-21 04:40:11 -0500 (Fri, 21 Dec 2007)
New Revision: 68488

Modified:
   projects/cluster/varia/sessionstress/PerfTest.java
Log:
ns

Modified: projects/cluster/varia/sessionstress/PerfTest.java
===================================================================
--- projects/cluster/varia/sessionstress/PerfTest.java	2007-12-21 09:37:18 UTC (rev 68487)
+++ projects/cluster/varia/sessionstress/PerfTest.java	2007-12-21 09:40:11 UTC (rev 68488)
@@ -65,6 +65,11 @@
             total_failed_writes+=client.getFailedWrites();
         }
 
+        if(num_clients < 1) {
+            System.err.println("No client completed successfully, will not compute results");
+            return;
+        }
+
         int failed_clients=num_threads - num_clients;
         int total_requests=total_successful_reads + total_successful_writes;
         double avg_time=total_time / num_clients;
@@ -183,8 +188,13 @@
         public void run() {
             try {
                 start=System.currentTimeMillis();
-                init(num_attrs, size);
-                barrier.await();
+                try {
+                    init(num_attrs, size);
+                    log("barrier.await()");
+                }
+                finally {
+                    barrier.await();
+                }
                 loop(num_requests);
             }
             catch(Exception e) {
@@ -193,6 +203,7 @@
             }
             finally {
                 stop=System.currentTimeMillis();
+                log("barrier.await()");
                 try {barrier.await(5000, TimeUnit.MILLISECONDS);} catch(Exception e) {}
                 setup_method.releaseConnection();
             }
@@ -234,7 +245,7 @@
         private void init(int num_attrs, int size) throws IOException {
             int rc=session.executeMethod(setup_method);
             if(rc != HttpStatus.SC_OK) {
-                error("failed initializing session", null);
+                throw new RuntimeException("failed initializing session", null);
             }
             else {
                 log("successfully initailized session with " + num_attrs + " attrs of " + size + " bytes");




More information about the jboss-cvs-commits mailing list