overtake 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. package/index.js +22 -18
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -59,7 +59,27 @@ const map = {
59
59
 
60
60
  export const defaultReporter = async (type, title, test) => {
61
61
  console.group(`${map[type]} ${title}`);
62
- await test({ test: defaultReporter, output: (report) => console.table(report) });
62
+ await test({
63
+ test: defaultReporter,
64
+ output: (report) =>
65
+ console.table(
66
+ report.success
67
+ ? {
68
+ [formatFloat(report.mode)]: {
69
+ med: formatFloat(report.med),
70
+ p95: formatFloat(report.p95),
71
+ p99: formatFloat(report.p99),
72
+ total: formatFloat(report.sum),
73
+ count: report.count,
74
+ },
75
+ }
76
+ : {
77
+ error: {
78
+ reason: report.error,
79
+ },
80
+ }
81
+ ),
82
+ });
63
83
  console.groupEnd();
64
84
  };
65
85
 
@@ -85,23 +105,7 @@ export const run = async (scripts, reporter) => {
85
105
  count: perform.count,
86
106
  args: perform.args,
87
107
  });
88
- if (result.success) {
89
- measureTest.output({
90
- [formatFloat(result.mode)]: {
91
- total: formatFloat(result.total),
92
- med: formatFloat(result.med),
93
- p95: formatFloat(result.p95),
94
- p99: formatFloat(result.p99),
95
- count: result.count,
96
- },
97
- });
98
- } else {
99
- measureTest.output({
100
- error: {
101
- reason: result.error,
102
- },
103
- });
104
- }
108
+ measureTest.output(result);
105
109
  });
106
110
  }
107
111
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overtake",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "NodeJS performance benchmark",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",