1
- const NODE_OVERHEAD_RESULTS_HEADER = [ 'Scenario' , 'Prev Requests/s' , 'New Requests/s' , 'Change %' ] ;
1
+ const NODE_OVERHEAD_RESULTS_HEADER = [ 'Scenario' , 'Requests/s' , '% of Baseline' , 'Prev Requests/s', 'Change %' ] ;
2
2
3
3
export class Formatter {
4
4
formatPercentageChange ( base = 0 , current = 0 ) {
@@ -24,8 +24,14 @@ export class Formatter {
24
24
return `${ formatted } %` ;
25
25
}
26
26
27
- formatResult ( name , base , current ) {
28
- return [ name , base , current , this . formatPercentageChange ( base , current ) ] ;
27
+ formatResult ( name , base , current , baseline ) {
28
+ return [
29
+ name ,
30
+ current || '-' ,
31
+ baseline != null ? this . formatPercentageChange ( baseline , current ) : '-' ,
32
+ base || '-' ,
33
+ this . formatPercentageChange ( base , current ) ,
34
+ ] ;
29
35
}
30
36
31
37
hasChanges ( base , current , threshold = 0 ) {
@@ -50,11 +56,18 @@ export class Formatter {
50
56
formatResults ( base , current ) {
51
57
const headers = NODE_OVERHEAD_RESULTS_HEADER ;
52
58
59
+ const baseline = current ?. baseline ;
60
+
53
61
return [
54
62
headers ,
55
63
this . formatResult ( 'Baseline' , base ?. baseline , current ?. baseline ) ,
56
- this . formatResult ( 'With Sentry' , base ?. withInstrument , current ?. withInstrument ) ,
57
- this . formatResult ( 'With Sentry (error only)' , base ?. withInstrumentErrorOnly , current ?. withInstrumentErrorOnly ) ,
64
+ this . formatResult ( 'With Sentry' , base ?. withInstrument , current ?. withInstrument , baseline ) ,
65
+ this . formatResult (
66
+ 'With Sentry (error only)' ,
67
+ base ?. withInstrumentErrorOnly ,
68
+ current ?. withInstrumentErrorOnly ,
69
+ baseline ,
70
+ ) ,
58
71
] ;
59
72
}
60
73
}
0 commit comments