[jbosscache-commits] JBoss Cache SVN: r5006 - in cache-bench-fwk/trunk/src/org/cachebench: tests and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Sun Jan 6 06:13:53 EST 2008


Author: mircea.markus
Date: 2008-01-06 06:13:52 -0500 (Sun, 06 Jan 2008)
New Revision: 5006

Modified:
   cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
   cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java
Log:
added some more logging

Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java	2008-01-06 00:37:11 UTC (rev 5005)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java	2008-01-06 11:13:52 UTC (rev 5006)
@@ -106,7 +106,8 @@
          int exitValue = process.waitFor();
          if (exitValue != 0)
          {
-            sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have an NOT zero exit code: " + exitValue, null));
+            sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have an NOT zero exit code: " + exitValue
+                  + ", originated from " +  getNodeDescription(), null));
          }
       log.debug("Terminating the tests...");
       TerminationRecord terminationRecord = new TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +

Modified: cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java	2008-01-06 00:37:11 UTC (rev 5005)
+++ cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java	2008-01-06 11:13:52 UTC (rev 5006)
@@ -30,6 +30,7 @@
    protected ExecutorService executor;
    private static final int EXECUTOR_SHUTDOWN_TIMEOUT_POLL_SECS = 60;
    protected Configuration configuration;
+   protected final int LOG_FREQUENCY = 5000;
 
    protected TestResult performTestWithObjectType(String testCaseName, CacheWrapper cache, Class valueClass, String testName, int sampleSize, int numThreads) throws Exception
    {
@@ -101,6 +102,7 @@
 
       for (int i = 0; i < sampleSize; i++)
       {
+         logOperation(i, "GETS");
          final int cycleNumber = i;
          Runnable r = new Runnable()
          {
@@ -147,6 +149,14 @@
       return stats;
    }
 
+   private void logOperation(int i, String s)
+   {
+      if ((i + 1) % LOG_FREQUENCY == 0)
+      {
+         log.info((i + 1) + " " + s + " were performed");
+      }
+   }
+
    /**
     * @param cache      The Cachewrapper on which the bechmark is conducted.
     * @param valueClass The value class instance which is going to be inserted into the Cache.
@@ -165,6 +175,7 @@
 
       for (int i = 0; i < sampleSize; i++)
       {
+         logOperation(i,"PUTS");
          final int cycleNumber = i;
          Runnable r = new Runnable()
          {




More information about the jbosscache-commits mailing list