[jbosscache-commits] JBoss Cache SVN: r5267 - in benchmarks/benchmark-fwk/trunk: conf and 2 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Jan 30 19:25:05 EST 2008


Author: manik.surtani at jboss.com
Date: 2008-01-30 19:25:05 -0500 (Wed, 30 Jan 2008)
New Revision: 5267

Modified:
   benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
   benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
   benchmarks/benchmark-fwk/trunk/runNode.sh
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/CsvBaseReportGenerator.java
Log:
Added proper naming of output files

Modified: benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh	2008-01-31 00:25:05 UTC (rev 5267)
@@ -14,13 +14,16 @@
 		for size in $scaling
 		do
 			./cluster.sh start $product $config $size
-			while [ ! -e performance-$size.csv ]
+
+			outputFileName=data-$product-$config-$size.csv
+
+			while [ ! -e $outputFileName ]
 			do
 				echo Waiting for report... 
 				sleep 60
 			done
 			sleep 60
-			mv performance-$size.csv output/$product-$config-$size.csv
+			mv outputFileName output/
 			sleep 10
 		done
 	done

Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench.xml	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench.xml	2008-01-31 00:25:05 UTC (rev 5267)
@@ -91,7 +91,7 @@
 		own report generators such as XML generators, graphic generators, etc
    -->
    <!-- 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-<nodeIndexInCluster>.csv' -->
+   '-generic-' then the name would be generated as follows: 'data-<cache-product>-<configuration>-<cluster-size>.csv' -->
    <report outputFile="-generic-" generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
 
 </cachebench>

Modified: benchmarks/benchmark-fwk/trunk/runNode.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/runNode.sh	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/runNode.sh	2008-01-31 00:25:05 UTC (rev 5267)
@@ -61,7 +61,7 @@
 
 . ./bindAddress.sh
 
-JVM_OPTIONS="${JVM_OPTIONS} -Dbind.address=${BIND_ADDRESS} -DcacheBenchFwk.cacheConfigFile=${TEST_CFG} -DcurrentIndex=${CURRENT_INDEX} -DclusterSize=${CLUSTER_SIZE} -DcurrentIndex=${CURRENT_INDEX} -Djava.net.preferIPv4Stack=${preferIPv4Stack}"
+JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.cachePrioductName=${CACHE_PRODUCT} -Dbind.address=${BIND_ADDRESS} -DcacheBenchFwk.cacheConfigFile=${TEST_CFG} -DcurrentIndex=${CURRENT_INDEX} -DclusterSize=${CLUSTER_SIZE} -DcurrentIndex=${CURRENT_INDEX} -Djava.net.preferIPv4Stack=${preferIPv4Stack}"
 TO_EXECUTE="java $JVM_OPTIONS -cp $CLASSPATH org.cachebench.CacheBenchmarkRunner"
 
 if [ "$DEBUG" = "debug" ]

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java	2008-01-31 00:25:05 UTC (rev 5267)
@@ -17,6 +17,7 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.HashMap;
 
 
 /**
@@ -30,6 +31,13 @@
    private Log logger = LogFactory.getLog(CacheBenchmarkRunner.class);
    private Log errorLogger = LogFactory.getLog("CacheException");
 
+   // information about how we are called:
+
+   String cacheProductName;
+   String configuraton;
+   int clusterSize;
+   Map<String, String> systemParams = new HashMap<String, String>();
+
    public static void main(String[] args)
    {
       String conf = null;
@@ -47,6 +55,20 @@
       }
    }
 
+   /**
+    * Initialise some params that may be passed in via JVM params
+    */
+   private void initJVMParams()
+   {
+      String configuraton = System.getProperty("cacheBenchFwk.cacheConfigFile");
+      String cacheProductName = System.getProperty("cacheBenchFwk.cachePrioductName");
+      String clusterSize = System.getProperty("clusterSize");
+
+      if (configuraton != null) systemParams.put("config", configuraton);
+      if (cacheProductName != null) systemParams.put("cacheProductName", cacheProductName);
+      if (clusterSize != null) systemParams.put("clusterSize", clusterSize);
+   }
+
    private CacheBenchmarkRunner()
    {
       this("cachebench.xml");
@@ -54,6 +76,7 @@
 
    private CacheBenchmarkRunner(String s)
    {
+      initJVMParams();
       // first, try and find the configuration on the filesystem.
       URL confFile = ConfigBuilder.findConfigFile(s);
       if (confFile == null)
@@ -105,8 +128,7 @@
             {
                Map<String,String> params = test.getParams();
                // now add the config file, if any is passed in:
-               String configSystemProperty = System.getProperty("cacheBenchFwk.cacheConfigFile");
-               if (configSystemProperty != null) params.put("config", configSystemProperty);
+               params.putAll(systemParams);
                logger.info("Initialising cache with params " + params);
                cache.init(params);
                barrier("BEFORE_WARMUP");
@@ -250,7 +272,9 @@
             generator = getReportGenerator(report);
             if (generator != null)
             {
-               generator.setConfigParams(report.getParams());
+               Map<String, String> params = report.getParams();
+               params.putAll(systemParams);
+               generator.setConfigParams(params);
                generator.setResults(results);
                generator.setClusterConfig(conf.getClusterConfig());
                generator.setOutputFile(report.getOutputFile());

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/AbstractReportGenerator.java	2008-01-31 00:25:05 UTC (rev 5267)
@@ -7,6 +7,7 @@
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Base implementation of {@link org.cachebench.reportgenerators.ReportGenerator}
@@ -17,7 +18,13 @@
    protected List<TestResult> results;
    protected Log log;
    protected ClusterConfig clusterConfig;
+   protected Map<String, String> params;
 
+   public void setConfigParams(Map<String, String> params)
+   {
+      this.params = params;
+   }
+
    public void setOutputFile(String fileName)
    {
       this.output = new File(getFileName(fileName));
@@ -27,7 +34,7 @@
    {
       if (fileName.indexOf("-generic-") >=0 )
       {
-         return "performance-" + clusterConfig.getClusterSize() + ".csv";
+         return "data-" + params.get("cacheProductName") + "-" + params.get("config") + "-" + params.get("clusterSize") + ".csv";
       }
       log.info("Filename for report generation is: " + fileName);
       return fileName;

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java	2008-01-31 00:25:05 UTC (rev 5267)
@@ -22,8 +22,10 @@
    private static Log log = LogFactory.getLog(ClusterReportGenerator.class);
    private String reportGeneratorClassName;
 
+   @Override
    public void setConfigParams(Map<String, String> configParams)
    {
+      super.setConfigParams(configParams);
       log.trace("Received config params: " + configParams);
       reportGeneratorClassName = configParams.get("generatorClassName");
    }

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/CsvBaseReportGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/CsvBaseReportGenerator.java	2008-01-30 18:36:19 UTC (rev 5266)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/CsvBaseReportGenerator.java	2008-01-31 00:25:05 UTC (rev 5267)
@@ -19,14 +19,8 @@
 {
    protected static Log log = LogFactory.getLog(CsvBaseReportGenerator.class); 
 
-   protected Map<String,String> configParams;
    private ArrayList footNotes;
 
-   public void setConfigParams(Map<String, String> configParams)
-   {
-      this.configParams = configParams;
-   }
-
    public void generate() throws Exception
    {
       try




More information about the jbosscache-commits mailing list