* Runs a benchmark with a preconfigured file * * @param file Relative filepath to preset benchmark configuration * @param runBenchmark Function to run a benchmark configuration
(file, runBenchmark = benchmarkAll)
| 460 | * @param runBenchmark Function to run a benchmark configuration |
| 461 | */ |
| 462 | async function runBenchmarkFromFile(file, runBenchmark = benchmarkAll) { |
| 463 | console.log('Running a preconfigured benchmark...'); |
| 464 | const { benchmark, browsers } = file; |
| 465 | if (cliArgs?.period != null) { |
| 466 | benchmark.model = scheduleModels(benchmark.model, cliArgs.period, cliArgs.date); |
| 467 | console.log( |
| 468 | `\nWill benchmark the following models: \n\t` + |
| 469 | `${benchmark.model.join('\n\t')} \n`); |
| 470 | } else { |
| 471 | console.log( |
| 472 | `\nWill benchmark all models in '${cliArgs.benchmarks}'.\n`); |
| 473 | } |
| 474 | await runBenchmark(benchmark, browsers); |
| 475 | } |
| 476 | |
| 477 | async function initializeWriting() { |
| 478 | if (cliArgs.firestore) { |
no test coverage detected
searching dependent graphs…