static async runBenchmarks(benchmarkUi = null, customJDB = null, options = {}) { if (benchmarkUi) { for (const benchmarkDescription of BenchmarkRunner.BenchmarkDescriptions) { const type = benchmarkDescription.benchmark.NAME; const keys = Object.keys(benchmarkDescription).filter(key => key !== 'benchmark'); benchmarkUi.addBenchmarkType(type, benchmarkDescription, keys); } } for (const benchmarkDescription of BenchmarkRunner.BenchmarkDescriptions) { // evaluate all combinations of params const type = benchmarkDescription.benchmark.NAME; const keys = Object.keys(benchmarkDescription).filter(key => key !== 'benchmark'); const combinationCount = BenchmarkRunner._getCombinationsCount(benchmarkDescription, keys); for (let i=0; i<combinationCount; ++i) { const params = BenchmarkRunner.indexToParameters(benchmarkDescription, keys, i); let result; try { const benchmark = new benchmarkDescription.benchmark(params); benchmark.setJDB(customJDB, options); result = await benchmark.run(); // eslint-disable-line no-await-in-loop } catch (e) { // console.log('\nSkipped invalid configuration', params, 'because of error', e); result = null; } if (benchmarkUi) { benchmarkUi.addBenchmarkResult(type, result); } } } }