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) {
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();
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);
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();