Skip to content

Commit a47c3b3

Browse files
committed
remove jstat from webdriver-ts
1 parent fc0d5c4 commit a47c3b3

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

webdriver-ts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"dependencies": {
3737
"chromedriver": "112.0.0",
3838
"cross-env": "7.0.3",
39-
"jstat": "1.9.6",
4039
"lighthouse": "10.1.1",
4140
"playwright": "1.33.0",
4241
"playwright-firefox": "1.33.0",

webdriver-ts/src/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export let config = {
6767
WARMUP_COUNT: 5,
6868
TIMEOUT: 60 * 1000,
6969
LOG_PROGRESS: true,
70-
LOG_DETAILS: false,
70+
LOG_DETAILS: true,
7171
LOG_DEBUG: false,
7272
LOG_TIMELINE: false,
7373
EXIT_ON_ERROR: null as boolean, // set from command line

webdriver-ts/src/computeDuration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("duration is computed matching to some hand checked examples", () => {
3333
expect(result.duration).toBe(67.348);
3434
expect(result.droppedNonMainProcessCommitEvents).toBe(false);
3535
expect(result.droppedNonMainProcessOtherEvents).toBe(false);
36-
expect(result.maxDeltaBetweenCommits).toBe(60.919);
36+
expect(result.maxDeltaBetweenCommits).toBe(2.304);
3737
expect(result.numberCommits).toBe(2);
3838
});
3939
// ## Use the commit after the function call

webdriver-ts/src/parseTrace.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@ import { BenchmarkOptions, config, initializeFrameworks } from "./common.js";
33
import { computeResultsCPU, parseCPUTrace, PlausibilityCheck } from "./timeline.js";
44

55
async function debugSingle() {
6+
let values = [];
67
// for (let i = 0; i < 12; i++) {
7-
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_${i}.json`;
8+
const trace = `unittests/dojo-v8.0.0-keyed_02_replace1k_0.json`;
9+
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_${i}.json`;
810
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_0.jsontraces/1more-v0.1.18-keyed_01_run1k_0.json`;
911
// const trace = `traces/alpine-v3.12.0-keyed_07_create10k_0.json`;
10-
const trace = `traces/arrowjs-v1.0.0-alpha.9-keyed_07_create10k_0.json`;
12+
// const trace = `traces/arrowjs-v1.0.0-alpha.9-keyed_07_create10k_0.json`;
1113
// const trace = `traces/better-react-v1.1.3-keyed_04_select1k_1.json`;
1214
// const trace = `traces/1more-v0.1.18-keyed_01_run1k_0.json`;
13-
console.log("analyzing trace ", trace);
14-
const cpuTrace = await computeResultsCPU(trace);
15-
console.log(trace, cpuTrace);
15+
console.log("analyzing trace ", trace);
16+
const cpuTrace = await computeResultsCPU(trace);
17+
console.log(trace, cpuTrace);
18+
values.push(cpuTrace.duration);
1619
// console.log(trace, await computeResultsJS(cpuTrace, config, trace, DurationMeasurementMode.LAST_PAINT))
1720
// }
21+
console.log(values);
1822
}
1923

2024
// eslint-disable-next-line @typescript-eslint/no-unused-vars

webdriver-ts/src/writeResults.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import * as fs from "fs";
22
import { BenchmarkInfo, BenchmarkType, CPUBenchmarkResult, fileName } from "./benchmarksCommon.js";
33
import { StartupBenchmarkResult, subbenchmarks } from "./benchmarksLighthouse.js";
44
import { FrameworkData, JsonResult, JsonResultData } from "./common.js";
5-
import pkg from "jstat";
6-
const { jStat } = pkg;
5+
import { stats } from "./stats.js";
76

87
export type ResultLightHouse = {
98
framework: FrameworkData;
@@ -67,15 +66,7 @@ function createResultFile(
6766
break;
6867
}
6968
let convertResult = (label: string, data: number[]) => {
70-
let s = jStat(data);
71-
let res = {
72-
min: s.min(),
73-
max: s.max(),
74-
mean: s.mean(),
75-
median: s.median(),
76-
stddev: s.stdev(true),
77-
values: data,
78-
};
69+
let res = stats(data);
7970
console.log(`result ${fileName(framework, benchmark)} ${label} ${JSON.stringify(res)}`);
8071
return res;
8172
};

0 commit comments

Comments
 (0)