browsertime 16.13.3 → 16.14.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 CHANGED
@@ -1,6 +1,9 @@
1
1
  # Browsertime changelog (we do [semantic versioning](https://semver.org))
2
2
 
3
-
3
+ ## 16.14.0 - 2022-08-26
4
+ ### Added
5
+ * Collect relative standard deviation and output that in the cli output [#1834](https://github.com/sitespeedio/browsertime/pull/1834). Before we only showed the actual standard deviation, with this fix we also show it in percentage, that makes it easier if you run tests on different hardware/networks and want to compare them.
6
+ * Collect number of processes that runs on the server that do the testing, before a test starts [#1833](https://github.com/sitespeedio/browsertime/pull/1833).
4
7
  ## 16.13.3 - 2022-08-17
5
8
 
6
9
  ### Fixed
@@ -48,7 +48,8 @@ function getNewResult(url, options) {
48
48
  extras: [],
49
49
  fullyLoaded: [],
50
50
  mainDocumentTimings: [],
51
- errors: []
51
+ errors: [],
52
+ server: { processesAtStart: [] }
52
53
  };
53
54
  }
54
55
 
@@ -183,9 +184,6 @@ class Collector {
183
184
 
184
185
  if (allData.batteryTemperature) {
185
186
  results.android.batteryTemperature.push(allData.batteryTemperature);
186
- statistics.addDeep({
187
- android: { batteryTemperature: allData.batteryTemperature }
188
- });
189
187
  }
190
188
 
191
189
  if (allData.markedAsFailure) {
@@ -193,6 +191,9 @@ class Collector {
193
191
  results.failureMessages = allData.failureMessages;
194
192
  }
195
193
 
194
+ if (allData.processesAtStart) {
195
+ results.server.processesAtStart.push(allData.processesAtStart);
196
+ }
196
197
  // If we don't have an error, use an empty array. In the future we want to push
197
198
  // more than one errors per run (maybe).
198
199
  results.errors.push(data.error || []);
@@ -309,7 +309,6 @@ class Engine {
309
309
  }
310
310
 
311
311
  const totalResult = collector.getResults();
312
-
313
312
  // Add extra fields to the HAR
314
313
  // to make the HAR files better when we use them in
315
314
  // compare.sitespeed.io
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
-
2
+ const os = require('os');
3
3
  const webdriver = require('selenium-webdriver');
4
4
  const log = require('intel').getLogger('browsertime');
5
5
  const SeleniumRunner = require('../seleniumRunner');
@@ -35,6 +35,7 @@ const {
35
35
  ContextClick,
36
36
  MouseMove
37
37
  } = require('./command/mouse/');
38
+ const getNumberOfRunningProcesses = require('../../support/processes');
38
39
 
39
40
  const { isAndroidConfigured, Android } = require('../../android');
40
41
  const Scroll = require('./command/scroll');
@@ -84,6 +85,9 @@ class Iteration {
84
85
  * @param {*} index - Which iteration it is
85
86
  */
86
87
  async run(navigationScript, index) {
88
+ if (os.platform() === 'darwin' || os.platform() === 'linux') {
89
+ this.processesAtStart = new Number(await getNumberOfRunningProcesses());
90
+ }
87
91
  const screenshotManager = new ScreenshotManager(
88
92
  this.storageManager,
89
93
  this.options
@@ -316,6 +320,8 @@ class Iteration {
316
320
  if (commands.meta.title) {
317
321
  result.title = commands.meta.title;
318
322
  }
323
+
324
+ result.processesAtStart = this.processesAtStart;
319
325
  return result;
320
326
  } catch (e) {
321
327
  log.error(e);
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ const execa = require('execa');
4
+ module.exports = async function () {
5
+ const { stdout } = await execa.command('ps aux | wc -l', { shell: true });
6
+ return stdout;
7
+ };
@@ -168,6 +168,7 @@ class Statistics {
168
168
  median: parseFloat(stats.median().toFixed(decimals)),
169
169
  mean: parseFloat(stats.amean().toFixed(decimals)),
170
170
  mdev: parseFloat((stats.stddev() / Math.sqrt(stats.length)).toFixed(4)), // "standard deviation of the mean"
171
+ rsd: parseFloat((100 * stats.stddev()) / stats.amean()), // Relative standard deviation
171
172
  stddev: parseFloat(stats.stddev().toFixed(decimals))
172
173
  };
173
174
  percentiles.forEach(p => {
@@ -18,7 +18,9 @@ module.exports = {
18
18
 
19
19
  let formatted = `${name}: ${fmt(multiple ? metric.median : metric)}`;
20
20
  if (extras) {
21
- formatted += ` (σ${fmt(metric.stddev.toFixed(2))})`;
21
+ formatted += ` (σ${fmt(metric.stddev.toFixed(2))} ${
22
+ metric.stddev > 0 ? metric.rsd.toFixed(1) : '0'
23
+ }%)`;
22
24
  }
23
25
  return formatted;
24
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "description": "Browsertime",
3
- "version": "16.13.3",
3
+ "version": "16.14.0",
4
4
  "bin": "./bin/browsertime.js",
5
5
  "dependencies": {
6
6
  "@cypress/xvfb": "1.2.4",
@@ -8,7 +8,7 @@
8
8
  "@sitespeed.io/chromedriver": "104.0.5112-29",
9
9
  "@sitespeed.io/edgedriver": "104.0.1293-47",
10
10
  "@sitespeed.io/geckodriver": "0.31.0-c",
11
- "@sitespeed.io/throttle": "4.0.1",
11
+ "@sitespeed.io/throttle": "5.0.0",
12
12
  "@sitespeed.io/tracium": "0.3.3",
13
13
  "btoa": "1.2.1",
14
14
  "chrome-har": "0.13.0",
@@ -26,7 +26,7 @@
26
26
  "lodash.merge": "4.6.2",
27
27
  "lodash.pick": "4.4.0",
28
28
  "lodash.set": "4.3.2",
29
- "selenium-webdriver": "4.3.1",
29
+ "selenium-webdriver": "4.4.0",
30
30
  "yargs": "17.4.1"
31
31
  },
32
32
  "optionalDependencies": {