browsertime 24.6.0 → 24.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/lib/core/engine/command/perfStats.js +67 -0
- package/lib/core/engine/commands.js +13 -0
- package/lib/firefox/perfStats.js +2 -4
- package/lib/firefox/webdriver/firefox.js +2 -2
- package/package.json +4 -4
- package/types/core/engine/command/perfStats.d.ts +43 -0
- package/types/core/engine/command/perfStats.d.ts.map +1 -0
- package/types/core/engine/commands.d.ts +2 -0
- package/types/core/engine/commands.d.ts.map +1 -1
- package/types/firefox/perfStats.d.ts +8 -0
- package/types/firefox/perfStats.d.ts.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Browsertime changelog (we do [semantic versioning](https://semver.org))
|
|
2
2
|
|
|
3
|
+
## 24.7.0 - 2025-05-13
|
|
4
|
+
### Added
|
|
5
|
+
* Added Edge and Edgedriver 136 [#2282](https://github.com/sitespeedio/browsertime/pull/2282).
|
|
6
|
+
* Add commands to start/stop and collect PerfStats performance counters for Firefox, thank you [Denis Palmeiro](https://github.com/dpalmeiro) for PR [#2279](https://github.com/sitespeedio/browsertime/pull/2279).
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
* Selenium 4.32.0 [#2281](https://github.com/sitespeedio/browsertime/pull/2281).
|
|
10
|
+
* Chromedriver 136 [#2280](https://github.com/sitespeedio/browsertime/pull/2280).
|
|
11
|
+
|
|
3
12
|
## 24.6.0 - 2025-05-05
|
|
4
13
|
### Added
|
|
5
14
|
* Updated the Docker container to use Chrome 136.0, Firefox 138 and Edge 135.0 [#2277](https://github.com/sitespeedio/browsertime/pull/2277).
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PerfStats } from '../../../firefox/perfStats.js';
|
|
2
|
+
/**
|
|
3
|
+
* Manages the PerfStats interface used for collecting Firefox performance counters.
|
|
4
|
+
*
|
|
5
|
+
* @class
|
|
6
|
+
* @hideconstructor
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export class PerfStatsInterface {
|
|
10
|
+
constructor(browser, options) {
|
|
11
|
+
/**
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
this.PerfStats = new PerfStats(browser);
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
this.options = options;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Starts PerfStats collection based on the given feature mask.
|
|
23
|
+
*
|
|
24
|
+
* @async
|
|
25
|
+
* @returns {Promise<void>} A promise that resolves when collection has started.
|
|
26
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
27
|
+
*/
|
|
28
|
+
// eslint-disable-next-line prettier/prettier
|
|
29
|
+
async start(featureMask = 0xFF_FF_FF_FF) {
|
|
30
|
+
if (this.options.browser === 'firefox') {
|
|
31
|
+
return this.PerfStats.start(featureMask);
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error('PerfStats only works in Firefox');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Stops PerfStats collection.
|
|
39
|
+
*
|
|
40
|
+
* @async
|
|
41
|
+
* @returns {Promise<void>} A promise that resolves when collection has stopped.
|
|
42
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
43
|
+
*/
|
|
44
|
+
async stop() {
|
|
45
|
+
if (this.options.browser === 'firefox') {
|
|
46
|
+
return this.PerfStats.stop();
|
|
47
|
+
} else {
|
|
48
|
+
throw new Error('PerfStats only works in Firefox');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Returns an object that has cumulative perfstats statistics across each
|
|
54
|
+
* process for the features that were enabled. Should be called before stop().
|
|
55
|
+
*
|
|
56
|
+
* @async
|
|
57
|
+
* @returns {Object} Returns an object with cumulative results.
|
|
58
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
59
|
+
*/
|
|
60
|
+
async collect() {
|
|
61
|
+
if (this.options.browser === 'firefox') {
|
|
62
|
+
return this.PerfStats.collect();
|
|
63
|
+
} else {
|
|
64
|
+
throw new Error('PerfStats only works in Firefox');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -28,6 +28,7 @@ import { Scroll } from './command/scroll.js';
|
|
|
28
28
|
import { Navigation } from './command/navigation.js';
|
|
29
29
|
import { GeckoProfiler } from '../../firefox/geckoProfiler.js';
|
|
30
30
|
import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js';
|
|
31
|
+
import { PerfStatsInterface } from './command/perfStats.js';
|
|
31
32
|
/**
|
|
32
33
|
* Represents the set of commands available in a Browsertime script.
|
|
33
34
|
* @hideconstructor
|
|
@@ -64,6 +65,10 @@ export class Commands {
|
|
|
64
65
|
options
|
|
65
66
|
);
|
|
66
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Manages GeckoProfiler functionality to collect performance profiles.
|
|
70
|
+
* @type {GeckoProfiler}
|
|
71
|
+
*/
|
|
67
72
|
const browserProfiler = new GeckoProfiler(browser, storageManager, options);
|
|
68
73
|
// Profiler
|
|
69
74
|
this.profiler = new GeckoProfilerCommand(
|
|
@@ -73,6 +78,14 @@ export class Commands {
|
|
|
73
78
|
options,
|
|
74
79
|
result
|
|
75
80
|
);
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Manages PerfStats functionality to collect performance counters.
|
|
84
|
+
* @type {PerfStatsInterface}
|
|
85
|
+
*/
|
|
86
|
+
const perfStats = new PerfStatsInterface(browser, options);
|
|
87
|
+
this.perfStats = perfStats;
|
|
88
|
+
|
|
76
89
|
const cdp = new ChromeDevelopmentToolsProtocol(
|
|
77
90
|
engineDelegate,
|
|
78
91
|
options.browser
|
package/lib/firefox/perfStats.js
CHANGED
|
@@ -2,14 +2,12 @@ import { getLogger } from '@sitespeed.io/log';
|
|
|
2
2
|
const log = getLogger('browsertime.firefox');
|
|
3
3
|
|
|
4
4
|
export class PerfStats {
|
|
5
|
-
constructor(runner
|
|
5
|
+
constructor(runner) {
|
|
6
6
|
this.runner = runner;
|
|
7
|
-
this.firefoxConfig = firefoxConfig;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
async start() {
|
|
9
|
+
async start(featureMask) {
|
|
11
10
|
const runner = this.runner;
|
|
12
|
-
const featureMask = this.firefoxConfig.perfStatsParams.mask;
|
|
13
11
|
const script = `ChromeUtils.setPerfStatsCollectionMask(${featureMask});`;
|
|
14
12
|
return runner.runPrivilegedScript(script, 'Start PerfStats Measurement');
|
|
15
13
|
}
|
|
@@ -176,8 +176,8 @@ export class Firefox {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
if (this.firefoxConfig.perfStats) {
|
|
179
|
-
this.perfStats = new PerfStats(runner
|
|
180
|
-
return this.perfStats.start();
|
|
179
|
+
this.perfStats = new PerfStats(runner);
|
|
180
|
+
return this.perfStats.start(this.firefoxConfig.perfStatsParams.mask);
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
this.testStartTime = Date.now();
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browsertime",
|
|
3
3
|
"description": "Get performance metrics from your web page using Browsertime.",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.7.0",
|
|
5
5
|
"bin": "./bin/browsertime.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./types/scripting.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@devicefarmer/adbkit": "3.3.8",
|
|
10
|
-
"@sitespeed.io/chromedriver": "
|
|
11
|
-
"@sitespeed.io/edgedriver": "
|
|
10
|
+
"@sitespeed.io/chromedriver": "136.0.7103-92",
|
|
11
|
+
"@sitespeed.io/edgedriver": "136.0.3240-64",
|
|
12
12
|
"@sitespeed.io/geckodriver": "0.36.0",
|
|
13
13
|
"@sitespeed.io/log": "0.2.6",
|
|
14
14
|
"@sitespeed.io/throttle": "5.0.1",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"fast-stats": "0.0.7",
|
|
20
20
|
"ff-test-bidi-har-export": "0.0.17",
|
|
21
21
|
"lodash.merge": "4.6.2",
|
|
22
|
-
"selenium-webdriver": "4.
|
|
22
|
+
"selenium-webdriver": "4.32.0",
|
|
23
23
|
"yargs": "17.7.2"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages the PerfStats interface used for collecting Firefox performance counters.
|
|
3
|
+
*
|
|
4
|
+
* @class
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
7
|
+
export class PerfStatsInterface {
|
|
8
|
+
constructor(browser: any, options: any);
|
|
9
|
+
/**
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private PerfStats;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
private options;
|
|
17
|
+
/**
|
|
18
|
+
* Starts PerfStats collection based on the given feature mask.
|
|
19
|
+
*
|
|
20
|
+
* @async
|
|
21
|
+
* @returns {Promise<void>} A promise that resolves when collection has started.
|
|
22
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
23
|
+
*/
|
|
24
|
+
start(featureMask?: number): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Stops PerfStats collection.
|
|
27
|
+
*
|
|
28
|
+
* @async
|
|
29
|
+
* @returns {Promise<void>} A promise that resolves when collection has stopped.
|
|
30
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
31
|
+
*/
|
|
32
|
+
stop(): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns an object that has cumulative perfstats statistics across each
|
|
35
|
+
* process for the features that were enabled. Should be called before stop().
|
|
36
|
+
*
|
|
37
|
+
* @async
|
|
38
|
+
* @returns {Object} Returns an object with cumulative results.
|
|
39
|
+
* @throws {Error} Throws an error if not running Firefox.
|
|
40
|
+
*/
|
|
41
|
+
collect(): any;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=perfStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perfStats.d.ts","sourceRoot":"","sources":["../../../../lib/core/engine/command/perfStats.js"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH;IACE,wCASC;IARC;;OAEG;IACH,kBAAuC;IACvC;;OAEG;IACH,gBAAsB;IAGxB;;;;;;OAMG;IAEH,6BAJa,OAAO,CAAC,IAAI,CAAC,CAUzB;IAED;;;;;;OAMG;IACH,QAHa,OAAO,CAAC,IAAI,CAAC,CASzB;IAED;;;;;;;OAOG;IACH,eAMC;CACF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export class Commands {
|
|
6
6
|
constructor(browser: any, engineDelegate: any, index: any, result: any, storageManager: any, pageCompleteCheck: any, context: any, videos: any, screenshotManager: any, scriptsByCategory: any, asyncScriptsByCategory: any, postURLScripts: any, options: any);
|
|
7
7
|
profiler: GeckoProfilerCommand;
|
|
8
|
+
perfStats: PerfStatsInterface;
|
|
8
9
|
/**
|
|
9
10
|
* Manages Chrome trace functionality, enabling custom profiling and trace collection in Chrome.
|
|
10
11
|
* @type {ChromeTrace}
|
|
@@ -144,6 +145,7 @@ export class Commands {
|
|
|
144
145
|
element: Element;
|
|
145
146
|
}
|
|
146
147
|
import { GeckoProfiler as GeckoProfilerCommand } from './command/geckoProfiler.js';
|
|
148
|
+
import { PerfStatsInterface } from './command/perfStats.js';
|
|
147
149
|
import { ChromeTrace } from './command/chromeTrace.js';
|
|
148
150
|
import { Click } from './command/click.js';
|
|
149
151
|
import { Scroll } from './command/scroll.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../lib/core/engine/commands.js"],"names":[],"mappings":"
|
|
1
|
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