[jbosscache-commits] JBoss Cache SVN: r5275 - in benchmarks/benchmark-fwk/trunk: src/org/cachebench/reportgenerators and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Jan 30 20:53:26 EST 2008


Author: manik.surtani at jboss.com
Date: 2008-01-30 20:53:26 -0500 (Wed, 30 Jan 2008)
New Revision: 5275

Modified:
   benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ChartGenerator.java
Log:
User friendly output

Modified: benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh	2008-01-31 01:39:17 UTC (rev 5274)
+++ benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh	2008-01-31 01:53:26 UTC (rev 5275)
@@ -1,8 +1,9 @@
 #!/bin/bash
 
+scaling="2 4 6 8"
 #scaling="2 4 6 8 10"
-scaling="2 4"
-configs="pess-repl-async.xml pess-repl-sync.xml" # pess-repl-async-br.xml"
+#scaling="2 4"
+configs="pess-repl-async.xml pess-repl-sync.xml pess-repl-async-br.xml"
 products="jbosscache-2.0.0 jbosscache-2.1.0"
 
 mkdir output
@@ -26,3 +27,8 @@
 		done
 	done
 done
+
+
+echo Generating charts ... 
+
+./generateChart -reportDir output

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ChartGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ChartGenerator.java	2008-01-31 01:39:17 UTC (rev 5274)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ChartGenerator.java	2008-01-31 01:53:26 UTC (rev 5275)
@@ -5,6 +5,7 @@
 import org.jfree.chart.ChartUtilities;
 import org.jfree.chart.JFreeChart;
 import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.chart.title.DateTitle;
 import org.jfree.data.category.DefaultCategoryDataset;
 
 import java.io.BufferedReader;
@@ -12,8 +13,6 @@
 import java.io.FileReader;
 import java.io.FilenameFilter;
 import java.io.IOException;
-import java.util.Collections;
-import java.util.Date;
 import java.util.StringTokenizer;
 
 /**
@@ -35,6 +34,7 @@
    static String reportDirectory;
    static boolean singleChart = true;
    DefaultCategoryDataset dataset;
+   static String chartName = "chart.png";
 
 
    private static void help()
@@ -45,6 +45,7 @@
 
    public static void main(String[] args) throws IOException
    {
+      long startTime = System.currentTimeMillis();
       System.out.println("Welcome to the ChartGenerator.");
       // the params we expect:
       for (int i = 0; i < args.length; i++)
@@ -72,16 +73,25 @@
       }
       if (!singleChart) throw new RuntimeException("Multiple charts not yet implemented");
       new ChartGenerator().generateChart();
+
+      System.out.println("Finished in " + ((System.currentTimeMillis() - startTime) / 1000) + " seconds! Chart saved as " + chartName);
    }
 
    private void generateChart() throws IOException
    {
       readData();
       JFreeChart chart = ChartFactory.createLineChart("CacheBenchFwk Report", "Cluster size", "Throughput (reqs/sec)",
-            dataset, PlotOrientation.HORIZONTAL, true, false, false);
+            dataset, PlotOrientation.VERTICAL, true, false, false);
+      chart.addSubtitle(new DateTitle());
 
-      chart.setSubtitles(Collections.singletonList("" + new Date()));
-      ChartUtilities.saveChartAsPNG(new File("chart.png"), chart, 600, 800);
+      File chartFile = new File(chartName);
+      if (chartFile.exists())
+      {
+         chartFile.renameTo(new File(chartName + "." + System.currentTimeMillis()));
+         chartFile = new File(chartName);
+      }
+
+      ChartUtilities.saveChartAsPNG(chartFile, chart, 600, 800);
    }
 
    private void readData() throws IOException




More information about the jbosscache-commits mailing list