@@ -457,11 +457,6 @@ export const toError = (value: unknown): Error => {
457457 }
458458}
459459
460- const toAverage = ( statistics : Statistics ) : string =>
461- `${ formatNumber ( mToNs ( statistics . mean ) ) } \xb1 ${ statistics . rme . toFixed ( 2 ) } %`
462- const toMedian = ( statistics : Statistics ) : string =>
463- `${ formatNumber ( mToNs ( statistics . p50 ) ) } \xb1 ${ formatNumber ( mToNs ( statistics . mad ) ) } `
464-
465460export const defaultConvertTaskResultForConsoleTable : ConsoleTableConverter = (
466461 task : Task
467462) : Record < string , number | string > => {
@@ -471,10 +466,10 @@ export const defaultConvertTaskResultForConsoleTable: ConsoleTableConverter = (
471466 'Task name' : task . name ,
472467 ...( state === 'aborted-with-statistics' || state === 'completed'
473468 ? {
474- 'Latency avg (ns)' : toAverage ( task . result . latency ) ,
475- 'Latency med (ns)' : toMedian ( task . result . latency ) ,
476- 'Throughput avg (ops/s)' : toAverage ( task . result . throughput ) ,
477- 'Throughput med (ops/s)' : toMedian ( task . result . throughput ) ,
469+ 'Latency avg (ns)' : ` ${ formatNumber ( mToNs ( task . result . latency . mean ) , 5 , 2 ) } \xb1 ${ task . result . latency . rme . toFixed ( 2 ) } %` ,
470+ 'Latency med (ns)' : ` ${ formatNumber ( mToNs ( task . result . latency . p50 ) , 5 , 2 ) } \xb1 ${ formatNumber ( mToNs ( task . result . latency . mad ) , 5 , 2 ) } ` ,
471+ 'Throughput avg (ops/s)' : ` ${ Math . round ( task . result . throughput . mean ) . toString ( ) } \xb1 ${ task . result . throughput . rme . toFixed ( 2 ) } %` ,
472+ 'Throughput med (ops/s)' : ` ${ Math . round ( task . result . throughput . p50 ) . toString ( ) } \xb1 ${ Math . round ( task . result . throughput . mad ) . toString ( ) } ` ,
478473 Samples : task . result . latency . samples . length ,
479474 }
480475 : state !== 'errored'
0 commit comments