@@ -2,7 +2,7 @@ import * as lib from "@mlabs-haskell/cardano-data-lite";
22
33import process from "process" ;
44
5- export const testExternalMemLeakImpl = ( config ) => async ( ) => {
5+ export const testExternalMemLeakImpl = config => async ( ) => {
66 const debug = false ;
77
88 const debugLog = ( ...args ) => {
@@ -47,7 +47,8 @@ export const testExternalMemLeakImpl = (config) => async () => {
4747 lastMeasurements . shift ( ) ;
4848 }
4949
50- const avgExternalMem = lastMeasurements . reduce ( ( a , b ) => a + b , 0 ) / lastMeasurements . length ;
50+ const avgExternalMem =
51+ lastMeasurements . reduce ( ( a , b ) => a + b , 0 ) / lastMeasurements . length ;
5152
5253 debugLog ( `Current external memory: ${ currentExternalMem } ` ) ;
5354 debugLog ( `Rolling average external memory: ${ avgExternalMem } ` ) ;
@@ -57,16 +58,16 @@ export const testExternalMemLeakImpl = (config) => async () => {
5758 externalMemUpperBound = referenceExternalMem * ( 1 + maxError / 100 ) ;
5859 debugLog (
5960 `\nReference external memory set at iteration ${ i } : ${ referenceExternalMem } \n` +
60- `Upper bound set to: ${ externalMemUpperBound } (maxError ${ maxError } %)`
61+ `Upper bound set to: ${ externalMemUpperBound } (maxError ${ maxError } %)`
6162 ) ;
6263 }
6364
6465 if ( referenceExternalMem !== null && i > refIteration ) {
6566 if ( avgExternalMem > externalMemUpperBound ) {
6667 console . error (
6768 `\n=== Potential Memory Leak Detected ===\n` +
68- `Iteration: ${ i } \n` +
69- `Rolling average external usage (${ avgExternalMem } ) exceeded upper bound (${ externalMemUpperBound } ).`
69+ `Iteration: ${ i } \n` +
70+ `Rolling average external usage (${ avgExternalMem } ) exceeded upper bound (${ externalMemUpperBound } ).`
7071 ) ;
7172 throw new Error ( "External memory leak detected." ) ;
7273 } else {
@@ -75,6 +76,7 @@ export const testExternalMemLeakImpl = (config) => async () => {
7576 }
7677 }
7778
78- debugLog ( `\nAll ${ numIterations } iterations completed without detecting a leak.` ) ;
79+ debugLog (
80+ `\nAll ${ numIterations } iterations completed without detecting a leak.`
81+ ) ;
7982} ;
80-
0 commit comments