From: Jérôme Benoit Date: Tue, 27 Jun 2023 21:20:30 +0000 (+0200) Subject: feat: display worker set/pool info at startup X-Git-Tag: v1.2.17~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0bde1ea1ef9f72552609d6314d0533d565a09aba;p=e-mobility-charging-stations-simulator.git feat: display worker set/pool info at startup Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 3612f281..6fe78d77 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -138,6 +138,7 @@ export class Bootstrap extends EventEmitter { }` ) ); + console.info(chalk.green('Worker set/pool information:'), this.workerImplementation?.info); this.started = true; this.starting = false; } else { diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 1812d06d..96a9901d 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -42,6 +42,8 @@ export class WorkerSet extends WorkerAbstract { get info(): SetInfo { return { + type: 'set', + worker: 'thread', size: this.size, elementsExecuting: [...this.workerSet].reduce( (accumulator, workerSetElement) => accumulator + workerSetElement.numberOfWorkerElements, diff --git a/src/worker/WorkerTypes.ts b/src/worker/WorkerTypes.ts index 99ce69cd..7bcb108e 100644 --- a/src/worker/WorkerTypes.ts +++ b/src/worker/WorkerTypes.ts @@ -9,6 +9,8 @@ export enum WorkerProcessType { } export type SetInfo = { + type: string; + worker: string; size: number; elementsExecuting: number; elementsPerWorker: number;