Skip to content

Commit

Permalink
show startup config
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Jun 27, 2023
1 parent de23ef6 commit c50e544
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BenchmarkRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export abstract class BenchmarkRunner extends Emitter<
super();
this.eventsRate = new Map(Object.entries(configuration)) as Map<EventKeys, number>;

const maxLabelLength = [...this.eventsRate].reduce((max, [key]) => Math.max(max, key.length), 0);

console.log('Events configuration:');
for (const [event, rate] of this.eventsRate) {
console.log(`${event.padStart(maxLabelLength)} -> ${rate} events per second`);
}
console.log('-------------------');

this.on('ready', () => this.turnOnTimers());
this.on('error', (error: unknown) => {
console.error(error);
Expand Down

0 comments on commit c50e544

Please sign in to comment.