@browserless/benchmark 10.2.5 → 10.2.6

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.2.5",
5
+ "version": "10.2.6",
6
6
  "main": "src/index.js",
7
7
  "author": {
8
8
  "email": "josefrancisco.verdu@gmail.com",
@@ -30,7 +30,6 @@
30
30
  ],
31
31
  "devDependencies": {
32
32
  "@kikobeats/time-span": "latest",
33
- "@lukeed/ms": "latest",
34
33
  "asciichart": "latest",
35
34
  "browserless": "latest",
36
35
  "debug-logfmt": "latest",
@@ -40,6 +39,7 @@
40
39
  "p-all": "3",
41
40
  "percentile": "latest",
42
41
  "picocolors": "latest",
42
+ "pretty-ms": "7",
43
43
  "process-stats": "latest",
44
44
  "sieve-of-eratosthenes": "latest",
45
45
  "term-img": "latest"
@@ -51,7 +51,7 @@
51
51
  "src"
52
52
  ],
53
53
  "license": "MIT",
54
- "gitHead": "d5f5d3bba991e4a2a3f88892e596414ce7a10688",
54
+ "gitHead": "316b9d9d779ef5082310c0bbe8626f0ebcccaac0",
55
55
  "scripts": {
56
56
  "coverage": "exit 0",
57
57
  "test": "exit 0"
package/src/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  const createBrowserless = require('browserless')
4
4
  const processStats = require('process-stats')
5
- const { format } = require('@lukeed/ms')
6
5
  const asciichart = require('asciichart')
7
6
  const { gray } = require('picocolors')
7
+ const prettyMs = require('pretty-ms')
8
8
  const Measured = require('measured')
9
9
  const pAll = require('p-all')
10
10
  const meow = require('meow')
@@ -107,7 +107,7 @@ const benchmark = async ({
107
107
  console.log(
108
108
  ` #${n < 10 ? `0${n}` : n} ${gray(
109
109
  `cpu=${cpu.pretty} mem=${memUsed.pretty} eventLoop=${delay.pretty} time=`
110
- )}${format(time)}`
110
+ )}${prettyMs(time)}`
111
111
  )
112
112
  return time
113
113
  }
@@ -148,7 +148,7 @@ const main = async () => {
148
148
  const graph = asciichart.plot(times, {
149
149
  offset: 6,
150
150
  height: 10,
151
- format: time => format(time, { keepDecimalsOnWholeSeconds: true })
151
+ format: time => prettyMs(time, { keepDecimalsOnWholeSeconds: true })
152
152
  })
153
153
 
154
154
  await strategy.onClose(browser)
@@ -161,13 +161,13 @@ const main = async () => {
161
161
  ${gray(' time:')} ${uptime.pretty}
162
162
  ${gray(' count:')} ${histogram.count}
163
163
  ${gray(' memUsed:')} ${memUsed.pretty}
164
- ${gray(' min:')} ${format(histogram.min)}
165
- ${gray(' max:')} ${format(histogram.max)}
166
- ${gray(' median:')} ${format(histogram.median)}
167
- ${gray(' p75:')} ${format(histogram.p75)}
168
- ${gray(' p95:')} ${format(histogram.p95)}
169
- ${gray(' p99:')} ${format(histogram.p99)}
170
- ${gray(' p999:')} ${format(histogram.p999)}`)
164
+ ${gray(' min:')} ${prettyMs(histogram.min)}
165
+ ${gray(' max:')} ${prettyMs(histogram.max)}
166
+ ${gray(' median:')} ${prettyMs(histogram.median)}
167
+ ${gray(' p75:')} ${prettyMs(histogram.p75)}
168
+ ${gray(' p95:')} ${prettyMs(histogram.p95)}
169
+ ${gray(' p99:')} ${prettyMs(histogram.p99)}
170
+ ${gray(' p999:')} ${prettyMs(histogram.p999)}`)
171
171
  }
172
172
 
173
173
  main().catch(error => console.error(error) || process.exit(1))
@@ -1,11 +1,12 @@
1
1
  'use strict'
2
2
 
3
- const { format } = require('@lukeed/ms')
3
+ const timeSpan = require('@kikobeats/time-span')({ format: require('pretty-ms') })
4
4
  const termImg = require('term-img')
5
5
 
6
- const timeSpan = require('@kikobeats/time-span')({ format })
7
-
8
- const printImage = image => termImg(image, { width: '50%' })
6
+ const printImage = image =>
7
+ termImg(image, {
8
+ width: '50%'
9
+ })
9
10
 
10
11
  const URLS = [
11
12
  'https://example.com',
package/src/timing.js CHANGED
@@ -4,7 +4,7 @@ const debug = require('debug-logfmt')('browserless:benchmark')
4
4
  const timeSpan = require('@kikobeats/time-span')()
5
5
  const createBrowser = require('browserless')
6
6
  const percentile = require('percentile')
7
- const { format } = require('@lukeed/ms')
7
+ const prettyMs = require('pretty-ms')
8
8
 
9
9
  const HEADLESS = true
10
10
  // const TMP_FOLDER = '/tmp'
@@ -59,7 +59,7 @@ main(takeScreenshot, { iterations: 100, url: 'https://front-24ypc8or0.zeit.sh/'
59
59
  .then(result => {
60
60
  console.log()
61
61
  Object.keys(result).forEach(key => {
62
- console.log(` – ${key}: ${format(percentile(95, result[key]))}`)
62
+ console.log(` – ${key}: ${prettyMs(percentile(95, result[key]))}`)
63
63
  })
64
64
  })
65
65
  .catch(error => console.error(error) || process.exit(1))