@browserless/benchmark 10.0.0 → 10.1.15

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@browserless/benchmark",
3
3
  "description": "Benchmarking tool for testing different browserless configurations",
4
4
  "homepage": "https://browserless.js.org/#/?id=benchmark",
5
- "version": "10.0.0",
5
+ "version": "10.1.15",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "josefrancisco.verdu@gmail.com",
@@ -29,6 +29,7 @@
29
29
  "puppeteer"
30
30
  ],
31
31
  "devDependencies": {
32
+ "@kikobeats/time-span": "latest",
32
33
  "asciichart": "latest",
33
34
  "browserless": "latest",
34
35
  "debug-logfmt": "latest",
@@ -41,8 +42,7 @@
41
42
  "pretty-ms": "7",
42
43
  "process-stats": "latest",
43
44
  "sieve-of-eratosthenes": "latest",
44
- "term-img": "latest",
45
- "time-span": "latest"
45
+ "term-img": "latest"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">= 12"
@@ -51,7 +51,7 @@
51
51
  "src"
52
52
  ],
53
53
  "license": "MIT",
54
- "gitHead": "9085ee165094687aaf15c2d9a429d1c6acb9fe83",
54
+ "gitHead": "314f90097a623f50a807d403d99313c6f7eb3f54",
55
55
  "scripts": {
56
56
  "coverage": "exit 0",
57
57
  "test": "exit 0"
@@ -1,46 +1,49 @@
1
1
  <!DOCTYPE html>
2
- <html><head>
3
- <title>Example Domain</title>
2
+ <html>
3
+ <head>
4
+ <title>Example Domain</title>
4
5
 
5
- <meta charset="utf-8">
6
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1">
8
- <style type="text/css">
9
- body {
10
- background-color: #f0f0f2;
11
- margin: 0;
12
- padding: 0;
13
- font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
14
-
15
- }
16
- div {
17
- width: 600px;
18
- margin: 5em auto;
19
- padding: 2em;
20
- background-color: #fdfdff;
21
- border-radius: 0.5em;
22
- box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
23
- }
24
- a:link, a:visited {
25
- color: #38488f;
26
- text-decoration: none;
27
- }
28
- @media (max-width: 700px) {
6
+ <meta charset="utf-8" />
7
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <style type="text/css">
10
+ body {
11
+ background-color: #f0f0f2;
12
+ margin: 0;
13
+ padding: 0;
14
+ font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', 'Open Sans',
15
+ 'Helvetica Neue', Helvetica, Arial, sans-serif;
16
+ }
29
17
  div {
18
+ width: 600px;
19
+ margin: 5em auto;
20
+ padding: 2em;
21
+ background-color: #fdfdff;
22
+ border-radius: 0.5em;
23
+ box-shadow: 2px 3px 7px 2px rgba(0, 0, 0, 0.02);
24
+ }
25
+ a:link,
26
+ a:visited {
27
+ color: #38488f;
28
+ text-decoration: none;
29
+ }
30
+ @media (max-width: 700px) {
31
+ div {
30
32
  margin: 0 auto;
31
33
  width: auto;
34
+ }
32
35
  }
33
- }
34
- </style>
35
- </head>
36
-
37
- <body>
38
- <div>
39
- <h1>Example Domain</h1>
40
- <p>This domain is for use in illustrative examples in documents. You may use this
41
- domain in literature without prior coordination or asking for permission.</p>
42
- <p><a href="https://www.iana.org/domains/example">More information...</a></p>
43
- </div>
44
-
36
+ </style>
37
+ </head>
45
38
 
46
- </body></html>
39
+ <body>
40
+ <div>
41
+ <h1>Example Domain</h1>
42
+ <p>
43
+ This domain is for use in illustrative examples in documents. You may use this domain in
44
+ literature without prior coordination or asking for permission.
45
+ </p>
46
+ <p><a href="https://www.iana.org/domains/example">More information...</a></p>
47
+ </div>
48
+ </body>
49
+ </html>
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const prettyMs = require('pretty-ms')
4
- const timeSpan = require('time-span')
3
+ const timeSpan = require('@kikobeats/time-span')({ format: require('pretty-ms') })
5
4
  const termImg = require('term-img')
6
5
 
7
6
  const printImage = image => termImg(image, { width: '50%' })
@@ -26,12 +25,12 @@ const main = async () => {
26
25
  for (const url of URLS) {
27
26
  const time = timeSpan()
28
27
  const buffer = await browserless.screenshot(url)
29
- console.log(`\n# ${url} ${prettyMs(time())}\n`)
28
+ console.log(`\n# ${url} ${time()}\n`)
30
29
  console.log(printImage(buffer))
31
30
  console.log()
32
31
  }
33
32
 
34
- console.log(`\n${prettyMs(total())}\n`)
33
+ console.log(`\n${total()}\n`)
35
34
 
36
35
  await browserless.close()
37
36
  }
package/src/timing.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict'
2
2
 
3
- const createBrowser = require('browserless')
4
3
  const debug = require('debug-logfmt')('browserless:benchmark')
4
+ const timeSpan = require('@kikobeats/time-span')()
5
+ const createBrowser = require('browserless')
5
6
  const percentile = require('percentile')
6
- const timeSpan = require('time-span')
7
7
  const prettyMs = require('pretty-ms')
8
8
 
9
9
  const HEADLESS = true