Author: mircea.markus
Date: 2008-01-03 05:32:35 -0500 (Thu, 03 Jan 2008)
New Revision: 4964
Modified:
cache-bench-fwk/trunk/conf/cachebench.xml
cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ReportGenerator.java
cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
Log:
enhanced logging
Modified: cache-bench-fwk/trunk/conf/cachebench.xml
===================================================================
--- cache-bench-fwk/trunk/conf/cachebench.xml 2008-01-03 10:02:41 UTC (rev 4963)
+++ cache-bench-fwk/trunk/conf/cachebench.xml 2008-01-03 10:32:35 UTC (rev 4964)
@@ -21,8 +21,8 @@
-->
<cluster bindAddress="127.0.0.1">
<member host="127.0.0.1" port="7800"/>
- <member host="127.0.0.1" port="7801"/>
- <member host="127.0.0.1" port="7802"/>
+ <!--<member host="127.0.0.1" port="7801"/>-->
+ <!--<member host="127.0.0.1" port="7802"/>-->
</cluster>
<!-- Each testcase represents either a single configuration or a cacheing product.
@@ -92,8 +92,8 @@
See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
own report generators such as XML generators, graphic generators, etc
-->
- <!-- The CSV report generated can be plugged in to a spreadsheet to generate
graphs, cluster size is
- needed so that the . -->
- <report outputFile="performance.csv"
generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
+ <!-- The CSV report generated can be plugged in to a spreadsheet to generate
graphs. If 'outputFile is set to
+ '-generic-' then the name would be generated as follows:
'performance-<clusterSize>.csv' -->
+ <report outputFile="-generic-"
generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
</cachebench>
Modified: cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-03 10:02:41
UTC (rev 4963)
+++ cache-bench-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java 2008-01-03 10:32:35
UTC (rev 4964)
@@ -238,8 +238,8 @@
{
generator.setConfigParams(report.getParams());
generator.setResults(results);
- generator.setOutputFile(new File(report.getOutputFile()));
generator.setClusterConfig(conf.getClusterConfig());
+ generator.setOutputFile(report.getOutputFile());
generator.generate();
logger.info("Report Generation Completed");
}
Modified:
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java
===================================================================
---
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java 2008-01-03
10:02:41 UTC (rev 4963)
+++
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java 2008-01-03
10:32:35 UTC (rev 4964)
@@ -17,11 +17,20 @@
protected Log log;
protected ClusterConfig clusterConfig;
- public void setOutputFile(File output)
+ public void setOutputFile(String fileName)
{
- this.output = output;
+ this.output = new File(getFileName(fileName));
}
+ private String getFileName(String fileName)
+ {
+ if (fileName.indexOf("-generic-") >=0 )
+ {
+ return "performance-" + clusterConfig.getClusterSize() +
".csv";
+ }
+ return fileName;
+ }
+
public void setResults(List<TestResult> results)
{
this.results = results;
Modified:
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
===================================================================
---
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java 2008-01-03
10:02:41 UTC (rev 4963)
+++
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java 2008-01-03
10:32:35 UTC (rev 4964)
@@ -65,7 +65,7 @@
{
CSVReportGenerator generator = new CSVReportGenerator();
generator.setResults(mergedResults);
- generator.setOutputFile(output);
+ generator.output = output;
generator.generate();
}
Modified: cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ReportGenerator.java
===================================================================
---
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ReportGenerator.java 2008-01-03
10:02:41 UTC (rev 4963)
+++
cache-bench-fwk/trunk/src/org/cachebench/reportgenerators/ReportGenerator.java 2008-01-03
10:32:35 UTC (rev 4964)
@@ -16,7 +16,7 @@
{
public void setConfigParams(Map<String, String> configParams);
- public void setOutputFile(File output);
+ public void setOutputFile(String fileName);
public void setResults(List<TestResult> results);
Modified: cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-01-03
10:02:41 UTC (rev 4963)
+++ cache-bench-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java 2008-01-03
10:32:35 UTC (rev 4964)
@@ -39,8 +39,17 @@
cache.put(PREFIX + currentNodeIndex, "true");
Thread.sleep(2000);//just to make sure that prev barrier closed its sockets etc
+ if (conf.getClusterConfig().getClusterSize() == 1)
+ {
+ log.info("Cluster size is one, no replication expected");
+ TestResult result = new TestResult();
+ result.setTestPassed(true);
+ result.setSkipReport(true);
+ return result;
+ }
+
boolean allNodesReplicated = nodesReplicated(cache, testCaseName, testName);
-
+
Map<SocketAddress, Object> receivedValues =
broadcastReplicationResult(allNodesReplicated);
cache.empty();
return allReplicatedFine(receivedValues);
@@ -52,7 +61,7 @@
ClusterBarrier barrier = new ClusterBarrier();
barrier.setConfig(conf.getClusterConfig());
barrier.barrier(String.valueOf(allNodesReplicated));
- Map<SocketAddress,Object> receivedValues = barrier.getReceivedMessages();
+ Map<SocketAddress, Object> receivedValues = barrier.getReceivedMessages();
log.info("Recieved following responses from barrier:" + receivedValues);
return receivedValues;
}
@@ -70,7 +79,7 @@
{
TestResult result = new TestResult();
result.setSkipReport(true);
- for (Object value: receivedValues.values())
+ for (Object value : receivedValues.values())
{
if (!"true".equals(value))
{
Show replies by date