1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | Object.defineProperty(exports, "__esModule", { value: true });
|
13 | exports.manualMode = void 0;
|
14 | const ansi = require("ansi-escape-sequences");
|
15 | const specs_1 = require("./specs");
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | async function manualMode(config, servers) {
|
21 | if (config.csvFileStats || config.csvFileRaw || config.jsonFile ||
|
22 | config.legacyJsonFile) {
|
23 | throw new Error(`Can't save results in manual mode`);
|
24 | }
|
25 | console.log('\nVisit these URLs in any browser:');
|
26 | const allServers = new Set([...servers.values()]);
|
27 | for (const spec of config.benchmarks) {
|
28 | console.log();
|
29 | if (spec.url.kind === 'local') {
|
30 | console.log(`${spec.name}${spec.url.queryString}` +
|
31 | (spec.url.version !== undefined ? ` [@${spec.url.version.label}]` :
|
32 | ''));
|
33 | }
|
34 | console.log(ansi.format(`[yellow]{${specs_1.specUrl(spec, servers, config)}}`));
|
35 | }
|
36 | for (const server of [...allServers]) {
|
37 | (async function () {
|
38 | while (true) {
|
39 | const result = await server.nextResults();
|
40 | server.endSession();
|
41 | console.log(`${result.millis.toFixed(3)} ms`);
|
42 | }
|
43 | })();
|
44 | }
|
45 | }
|
46 | exports.manualMode = manualMode;
|
47 |
|
\ | No newline at end of file |