Permalink
Browse files

Tests now optionally only compare latest run with GA releases, on by …

…default.

Conflicts:

	src/main/java/org/neo4j/bench/regression/main/Main.java
  • Loading branch information...
1 parent 270ee62 commit fa1a70be3f4e6592dc74825d7ed03c4899963dc0 @jakewins jakewins committed Apr 23, 2012
@@ -175,4 +175,20 @@ public static Stats parse( String line )
result.sustainedWritesPerSec = sustainedWrites;
return result;
}
+
+ public boolean isGARelease()
+ {
+ String version = getVersion().toLowerCase();
+ return !version.contains("-snapshot") && !version.contains("m") && !version.contains("rc") && !version.equals("n/a");
+ }
+
+ private String getVersion() {
+ // 03-12 06:12 [1.7-SNAPSHOT]
+ String [] parts = name.split("\\[");
+ if(parts.length == 2) {
+ String version = parts[1].substring(0, parts[1].length() - 1);
+ return version;
+ }
+ return "N/A";
+ }
}
@@ -64,12 +64,12 @@
private boolean hasProcessed = false;
public GenerateOpsPerSecChart( String inputFilename, String outputFilename,
- double threshold )
+ double threshold, boolean onlyCompareToGAReleases )
{
this.inputFilename = inputFilename;
this.outputFilename = outputFilename;
this.threshold = threshold;
- data = loadOpsPerSecond( this.inputFilename );
+ data = loadOpsPerSecond( this.inputFilename, onlyCompareToGAReleases );
}
public void process() throws Exception
@@ -198,7 +198,7 @@ private DefaultCategoryDataset generateDataset()
* Opens the operations per second file, reads in the contents and creates a
* SortedSet of the therein stored Stats.
*/
- public static SortedSet<Stats> loadOpsPerSecond( String fileName )
+ public static SortedSet<Stats> loadOpsPerSecond( String fileName, boolean onlyCompareToGAReleases )
{
File dataFile = new File( fileName );
if ( !dataFile.exists() )
@@ -207,19 +207,24 @@ private DefaultCategoryDataset generateDataset()
}
BufferedReader reader = null;
SortedSet<Stats> result = new TreeSet<Stats>();
- Stats currentStat;
+ Stats currentStat = null;
try
{
reader = new BufferedReader( new FileReader( dataFile ) );
String line; // The current line
while ( ( line = reader.readLine() ) != null )
{
currentStat = Stats.parse( line );
- if ( currentStat != null )
+ if ( currentStat != null && (!onlyCompareToGAReleases || currentStat.isGARelease()))
{
result.add( currentStat );
}
}
+
+ // Add the latest result, even if it was not a GA
+ if(currentStat != null && !currentStat.isGARelease()) {
+ result.add(currentStat);
+ }
}
catch ( IOException e )
{
@@ -43,10 +43,12 @@ public static void main( String[] args ) throws Exception
{
Args argz = new Args( args );
long timeToRun = Long.parseLong( argz.get( "time-to-run", "120" ) ); // Time in minutes
+
Map<String, String> props = new HashMap<String, String>();
props.put( Config.USE_MEMORY_MAPPED_BUFFERS, "true" );
final EmbeddedGraphDatabase db = new EmbeddedGraphDatabase( "db" );
final MixedLoadBenchCase myCase = new MixedLoadBenchCase( timeToRun );
+
/*
* Commented out because it breaks windows but it is nice to have for
* testing on real OSes
@@ -79,11 +81,20 @@ public void handle( Signal arg0 )
String chartFilename = argz.get( GenerateOpsPerSecChart.CHART_FILE_ARG, "chart.png" );
double threshold = Double.parseDouble( argz.get( "threshold", "0.05" ) );
String neoVersion = argz.get( "neo4j-version", "N/A" );
+<<<<<<< HEAD
appendNewStatsToFile(results, statsFileName, neoVersion);
GenerateOpsPerSecChart aggregator = new GenerateOpsPerSecChart(statsFileName, chartFilename, threshold );
+=======
+ boolean onlyCompareToGAReleases = Boolean.parseBoolean( argz.get( "only-compare-to-ga", "true" ) ); /* Compare performance only to GA releases */
+
+ appendNewStatsToFile(results, statsFileName, neoVersion);
+
+ GenerateOpsPerSecChart aggregator = new GenerateOpsPerSecChart(statsFileName, chartFilename, threshold, onlyCompareToGAReleases );
+
+>>>>>>> 92d75b6... Tests now optionally only compare latest run with GA releases, on by default.
aggregator.process();
aggregator.generateChart();

0 comments on commit fa1a70b

Please sign in to comment.