Skip to content

Commit

Permalink
fix: printing of result when interrupted (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdscih committed Mar 29, 2022
1 parent f209100 commit 2259108
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ yarn.lock
build/Release

profile-*

.devcontainer
2 changes: 1 addition & 1 deletion lib/printResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const printResult = (result, opts) => {
head: asColor(chalk.cyan, ['Stat', '2.5%', '50%', '97.5%', '99%', 'Avg', 'Stdev', 'Max'])
})
shortLatency.push(asLowRow(chalk.bold('Latency'), asMs(result.latency)))
logToLocalStr(shortLatency.toString())
logToLocalStr('\n' + shortLatency.toString())

const requests = new Table({
head: asColor(chalk.cyan, ['Stat', '1%', '2.5%', '50%', '97.5%', 'Avg', 'Stdev', 'Min'])
Expand Down
1 change: 1 addition & 0 deletions test/basic-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const lines = [
/10 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
1 change: 1 addition & 0 deletions test/cli-ipc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const lines = [
/10 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
3 changes: 3 additions & 0 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test('should run benchmark against server', (t) => {
/10 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down Expand Up @@ -66,6 +67,7 @@ test('should parse HAR file and run requests', (t) => {
/1 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down Expand Up @@ -207,6 +209,7 @@ test('run with workers', { skip: !hasWorkerSupport }, (t) => {
/4 workers.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
1 change: 1 addition & 0 deletions test/envPort.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const lines = [
/10 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
1 change: 1 addition & 0 deletions test/onPort.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test('--on-port flag', { skip: !hasAsyncHooks() }, (t) => {
/10 connections.*$/,
/$/,
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
1 change: 1 addition & 0 deletions test/printResult-renderStatusCodes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const childProcess = require('child_process')
test('should stdout (print) the result', (t) => {
const lines = [
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down
1 change: 1 addition & 0 deletions test/printResult.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const printResult = require('../lib/printResult')
test('should stdout (print) the result', (t) => {
const lines = [
/.*/,
/$/,
/Stat.*2\.5%.*50%.*97\.5%.*99%.*Avg.*Stdev.*Max.*$/,
/.*/,
/Latency.*$/,
Expand Down

0 comments on commit 2259108

Please sign in to comment.