Author: mircea.markus
Date: 2008-01-06 11:11:03 -0500 (Sun, 06 Jan 2008)
New Revision: 5009
Modified:
cache-bench-fwk/trunk/smartfrog/cacheBenchComponent.sf
cache-bench-fwk/trunk/smartfrog/main.sf
cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
cache-bench-fwk/trunk/src/org/cachebench/warmup/CacheWarmup.java
Log:
we can run tests on multiple cluster configs now
Modified: cache-bench-fwk/trunk/smartfrog/cacheBenchComponent.sf
===================================================================
--- cache-bench-fwk/trunk/smartfrog/cacheBenchComponent.sf 2008-01-06 13:20:52 UTC (rev
5008)
+++ cache-bench-fwk/trunk/smartfrog/cacheBenchComponent.sf 2008-01-06 16:11:03 UTC (rev
5009)
@@ -3,7 +3,7 @@
BaseCacheBenchPrim extends Prim {
sfClass "org.cachebench.smartfrog.CacheBenchmarkPrim";
- scriptToExec "runNode.sh"
+ scriptToExec "./runNode.sh"
//FQN of the directory where the framework was checked out (noramally is th eparent of
the dir that contains this file)
//this should be edited
Modified: cache-bench-fwk/trunk/smartfrog/main.sf
===================================================================
--- cache-bench-fwk/trunk/smartfrog/main.sf 2008-01-06 13:20:52 UTC (rev 5008)
+++ cache-bench-fwk/trunk/smartfrog/main.sf 2008-01-06 16:11:03 UTC (rev 5009)
@@ -4,61 +4,431 @@
BaseCacheBenchPrim extends Prim {
sfClass "org.cachebench.smartfrog.CacheBenchmarkPrim";
- scriptToExec "./runNode.sh"
+ scriptToExec "runNode.bat"
//FQN of the directory where the framework was checked out (noramally is th eparent of
the dir that contains this file)
//this should be edited
- cacheBenchmarkHome "/qa/home/mmarkus/code/cache-bench-fwk";
+ cacheBenchmarkHome "/projects/jboss/cache/benchmark/cache-bench-fwk";
//should be the name of a subdirectory of 'cache-products' directory.
cacheDistribution "jbosscache-2.0.0";
+ //might take a value from 0..max_nr_of_nodes, representing the index of the current
node in the cluster
+ nodeIndex TBD;
+
//defines on how many nodes the benchmark will run
- clusterSize 1;
+ clusterSize TBD;
+ minClusterSize TBD;
+ maxClusterSize TBD;
- //might take a value from 0..max_nr_of_nodes, representing the index of the current
node in the cluster
- nodeIndex TBD;
}
sfConfig extends Compound {
- node1 extends BaseCacheBenchPrim{
- sfProcessHost "cluster01";
- nodeIndex 0;
+ minimumClusterSize 0;
+ maximumClusterSize 9;
+
+ oneClusterSize extends Compound {
+
+ c1FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize 1;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
-
- node2 extends BaseCacheBenchPrim{
- sfProcessHost "cluster02";
- nodeIndex 1;
+
+ twoClusterSize extends Compound {
+
+ sizeOfTheCluster 2;
+
+ c2FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c2SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
-
- node3 extends BaseCacheBenchPrim{
- sfProcessHost "cluster03";
- nodeIndex 2;
+
+ threeClusterSize extends Compound {
+
+ sizeOfTheCluster 3;
+
+ c3FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c3SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c3ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
-
- node4 extends BaseCacheBenchPrim{
- sfProcessHost "cluster04";
- nodeIndex 3;
+
+ fourClusterSize extends Compound {
+
+ sizeOfTheCluster 4;
+
+ c4FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c4SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c4ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c4ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
- node5 extends BaseCacheBenchPrim{
- sfProcessHost "cluster05";
- nodeIndex 4;
+ fiveClusterSize extends Compound {
+
+ sizeOfTheCluster 5;
+
+ c5FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c5SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c5ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c5ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c5FifthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 4;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
+
+ sixClusterSize extends Compound {
+
+ sizeOfTheCluster 6;
+
+ c6FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c6SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c6ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c6ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c6FifthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 4;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c6SixthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 5;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+ }
- node6 extends BaseCacheBenchPrim{
- sfProcessHost "cluster06";
- nodeIndex 5;
+ sevenClusterSize extends Compound {
+
+ sizeOfTheCluster 7;
+
+ c7FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7FifthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 4;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7SixthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 5;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c7SeventhMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 6;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
- node7 extends BaseCacheBenchPrim{
- sfProcessHost "cluster07";
- nodeIndex 6;
+ eightClusterSize extends Compound {
+
+ sizeOfTheCluster 8;
+
+ c8FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8FifthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 4;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8SixthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 5;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8SeventhMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 6;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c8EighthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 7;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
- node8 extends BaseCacheBenchPrim{
- sfProcessHost "cluster08";
- nodeIndex 7;
+ nineClusterSize extends Compound {
+
+ sizeOfTheCluster 9;
+
+ c9FirstMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 0;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9SecondMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 1;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9ThirdMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 2;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9ForthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 3;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9FifthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 4;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9SixthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 5;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9SeventhMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 6;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9EighthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 7;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
+
+ c9NinthMember extends BaseCacheBenchPrim {
+ sfProcessHost "localhost";
+ nodeIndex 7;
+ clusterSize ATTRIB sizeOfTheCluster;
+ minClusterSize ATTRIB minimumClusterSize;
+ maxClusterSize ATTRIB maximumClusterSize;
+ }
}
+
}
Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-06
13:20:52 UTC (rev 5008)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java 2008-01-06
16:11:03 UTC (rev 5009)
@@ -22,6 +22,8 @@
private File toRunIn;
private int clusterSize = -1;
private String scriptToExec;
+ private int minClusterSize;
+ private int maxClusterSize;
public CacheBenchmarkPrim() throws RemoteException
{
@@ -31,7 +33,6 @@
{
super.sfDeploy();
log = super.sfGetApplicationLog();
- log.setLevel(LogSF.LOG_LEVEL_ALL);
log.trace("deploy started");
//reading the attributes here
nodeIndex = (Integer) sfResolve("nodeIndex");
@@ -42,6 +43,10 @@
log.info("Received homedir: " + toRunIn);
clusterSize = (Integer)sfResolve("clusterSize");
log.info("Received cluster size: " + clusterSize);
+ minClusterSize = (Integer) sfResolve("minClusterSize");
+ log.info("Received MIN cluster size: " + minClusterSize);
+ maxClusterSize = (Integer) sfResolve("maxClusterSize");
+ log.info("Received MAX cluster size: " + maxClusterSize);
scriptToExec = (String) sfResolve("scriptToExec");
log.info("Received stringToExec: " + scriptToExec);
log.trace("Deploy finished");
@@ -49,49 +54,37 @@
public synchronized void sfStart() throws SmartFrogException, RemoteException
{
- Thread thread = new Thread()
+ if ((nodeIndex + 1) < clusterSize)
{
- public void run()
+ log.info("Running in a separate thread, not last node in the compound"
+ getNodeDescription());
+ Thread thread = new Thread()
{
- try
+ public void run()
{
runBenchmark();
- } catch (SmartFrogException e)
- {
- log.error("Unexpected error:" + e.getMessage(), e);
-
- } catch (IOException e)
- {
- log.warn("Does the script have X rights?", e);
- terminate(e);
-
- } catch (InterruptedException e)
- {
- log.err("This is quite strange", e);
- terminate(e);
}
- }
- private void terminate(Exception e)
- {
- TerminationRecord terminationRecord = new
TerminationRecord(TerminationRecord.ABNORMAL , "terminated the benchmark " +
- getNodeDescription(),null, e);
- sfTerminate(terminationRecord);
-
- }
- };
- thread.start();
+ };
+ thread.start();
+ }
+ //the last node should run in a sync manner so that the coumpound would only end
when the test ends
+ else
+ {
+ log.info("Running in the same thread as this is the last node in the
compound " + getNodeDescription());
+ runBenchmark();
+ }
}
private void runBenchmark()
- throws SmartFrogException, IOException, InterruptedException
{
- super.sfStart();
- log.trace("Entered sfStart...");
- if (clusterSize <= nodeIndex)
+ try
{
- log.info("Not processing this node" + getNodeDescription());
- return;
- }
+ super.sfStart();
+ log.trace("Entered sfStart...");
+ if (clusterSize <= nodeIndex)
+ {
+ log.info("Not processing this node" + getNodeDescription());
+ return;
+ }
String command = scriptToExec + " " + nodeIndex + " " +
cacheDistribution + " -DclusterSize=" + clusterSize;
log.info("Executing command: " + command);
Process process = Runtime.getRuntime().exec(command, null, toRunIn);
@@ -100,20 +93,54 @@
String line;
while ((line = bufferedReader.readLine()) != null)
{
- log.debug(scriptToExec + " >>> " + line);
+ log.info(scriptToExec + " >>> " + line);
}
bufferedReader.close();
int exitValue = process.waitFor();
if (exitValue != 0)
{
sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have
an NOT zero exit code: " + exitValue
- + ", originated from " + getNodeDescription(), null));
+ + ", originated from " + getNodeDescription(), null));
}
- log.debug("Terminating the tests...");
- TerminationRecord terminationRecord = new
TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +
- getNodeDescription(), null);
+
+ correctTerminationOfTestsIfNeeded();
+ } catch (SmartFrogException e)
+ {
+ log.error("Unexpected error:" + e.getMessage(), e);
+ terminate(e);
+ } catch (IOException e)
+ {
+ log.warn("Does the script have X rights?", e);
+ terminate(e);
+
+ } catch (InterruptedException e)
+ {
+ log.err("This is quite strange", e);
+ terminate(e);
+ }
+ }
+
+ /**
+ * The test will only be terminated if this is the last cluster compound running.
+ */
+ private void correctTerminationOfTestsIfNeeded()
+ {
+ if (this.clusterSize == this.maxClusterSize)
+ {
+ log.info("Good news, terminating ALL the tests, terminator is " +
getNodeDescription());
+ TerminationRecord terminationRecord = new
TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +
+ getNodeDescription(), null);
+ sfTerminate(terminationRecord);
+ log.info("Test terminated successfully " + getNodeDescription());
+ }
+ }
+
+ private void terminate(Exception e)
+ {
+ TerminationRecord terminationRecord = new
TerminationRecord(TerminationRecord.ABNORMAL , "terminated the benchmark " +
+ getNodeDescription(),null, e);
sfTerminate(terminationRecord);
- log.debug("Test terminated successfully " + getNodeDescription());
+
}
private File getFwkHomeDir()
Modified: cache-bench-fwk/trunk/src/org/cachebench/warmup/CacheWarmup.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/warmup/CacheWarmup.java 2008-01-06 13:20:52
UTC (rev 5008)
+++ cache-bench-fwk/trunk/src/org/cachebench/warmup/CacheWarmup.java 2008-01-06 16:11:03
UTC (rev 5009)
@@ -1,7 +1,8 @@
package org.cachebench.warmup;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.cachebench.CacheWrapper;
-import org.cachebench.config.NVPair;
import java.util.HashMap;
import java.util.Map;
@@ -15,6 +16,8 @@
public abstract class CacheWarmup
{
+ private static final Log log = LogFactory.getLog(CacheWarmup.class);
+
private Map<String, String> configParams = new HashMap<String, String>();
public void setConfigParams(Map<String, String> configParams)
@@ -32,7 +35,9 @@
*/
public final void warmup(CacheWrapper cacheWrapper) throws Exception
{
+ long startTime = System.currentTimeMillis();
performWarmupOperations(cacheWrapper);
+ log.info("The warmup took: " + ((System.currentTimeMillis() - startTime)
/ 1000) + " seconds." );
cacheWrapper.empty();
}