]> source.dussan.org Git - sonarqube.git/commitdiff
Use default 8% for error margin of performance tests
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 9 Mar 2015 09:36:35 +0000 (10:36 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 9 Mar 2015 09:36:35 +0000 (10:36 +0100)
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/Benchmark.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/IssueIndexBenchmarkTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceIndexBenchmarkTest.java

index a6003b576b0684052e5c52f63393750662d2bc51..e4d7e7fa6704e4e85090047ad79a6f28ff99d446 100644 (file)
@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
 public class Benchmark extends ErrorCollector {
 
   private static final boolean ENABLED = "true".equals(System.getProperty("enableBenchmarkAssertions"));
+  public static final double DEFAULT_ERROR_MARGIN_PERCENTS = 0.08;
 
   static {
     if (ENABLED) {
index ba5a6aa4d9c41c6d36d94a1cd56f94eadad8a1ec..8abfd3d18d702e4567eb4d5a784bb1ce28c1628e 100644 (file)
@@ -112,7 +112,7 @@ public class IssueIndexBenchmarkTest {
     long period = System.currentTimeMillis() - start;
     long throughputPerSecond = 1000 * issues.count.get() / period;
     LOGGER.info(String.format("%d issues indexed in %d ms (%d docs/second)", issues.count.get(), period, throughputPerSecond));
-    benchmark.expectAround("Throughput to index issues", throughputPerSecond, 3400, 0.06);
+    benchmark.expectAround("Throughput to index issues", throughputPerSecond, 3400, Benchmark.DEFAULT_ERROR_MARGIN_PERCENTS);
 
     // be sure that physical files do not evolve during estimation of size
     tester.get(EsClient.class).prepareOptimize("issues").get();
index 479408f674503185a4fd737be422b91f1fd32509..73179f4fefa842caab4e6187097d2ac1e30f1b80 100644 (file)
@@ -84,7 +84,7 @@ public class SourceDbBenchmarkTest {
       long period = end - start;
       long throughputPerSecond = 1000L * counter.get() / period;
       LOGGER.info(String.format("%d FILE_SOURCES rows scrolled in %d ms (%d rows/second)", counter.get(), period, throughputPerSecond));
-      benchmark.expectAround("Throughput to scroll FILE_SOURCES", throughputPerSecond, 120, 0.08);
+      benchmark.expectAround("Throughput to scroll FILE_SOURCES", throughputPerSecond, 120, Benchmark.DEFAULT_ERROR_MARGIN_PERCENTS);
 
     } finally {
       DbUtils.closeQuietly(connection);
index 6480c4ef0dfc5b27f00b50e97142f502bf2a6cb2..a5751ae8cb3df837589b00e5a2d45804ba7884f6 100644 (file)
@@ -88,7 +88,7 @@ public class SourceIndexBenchmarkTest {
     long nbLines = files.count.get() * LINES_PER_FILE;
     long throughputPerSecond = 1000L * nbLines / period;
     LOGGER.info(String.format("%d lines indexed in %d ms (%d docs/second)", nbLines, period, throughputPerSecond));
-    benchmark.expectAround("Throughput to index source lines", throughputPerSecond, 7800, 0.04);
+    benchmark.expectAround("Throughput to index source lines", throughputPerSecond, 7800, Benchmark.DEFAULT_ERROR_MARGIN_PERCENTS);
 
     // be sure that physical files do not evolve during estimation of size
     tester.get(EsClient.class).prepareOptimize(SourceLineIndexDefinition.INDEX).get();