From 0bde1ea1ef9f72552609d6314d0533d565a09aba Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 27 Jun 2023 23:20:30 +0200 Subject: [PATCH] feat: display worker set/pool info at startup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 1 + src/worker/WorkerSet.ts | 2 ++ src/worker/WorkerTypes.ts | 2 ++ 3 files changed, 5 insertions(+) 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; -- 2.34.1