Skip to content
Prev Previous commit
Next Next commit
Print regression percentage
  • Loading branch information
WunderBart committed Dec 8, 2023
commit 3960e67e3b614d2ce83e0d1fea53f2e0ff2a7aab
7 changes: 6 additions & 1 deletion bin/check-performance-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ fs.readdir( resultsPath, ( err, files ) => {
console.log( 'Performance regression detected:' );
regressedMetrics.forEach(
( { file, metric, branchValue, trunkValue } ) => {
const percent = (
( ( branchValue - trunkValue ) / trunkValue ) *
100
).toFixed( 2 );

console.log(
`- In ${ file }: ${ metric } increased from ${ trunkValue } to ${ branchValue }`
`- In ${ file }: ${ metric } increased by ${ percent }% (from ${ trunkValue } to ${ branchValue })`
);
}
);
Expand Down