feat: display worker set/pool info at startup
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 27 Jun 2023 21:20:30 +0000 (23:20 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 27 Jun 2023 21:20:30 +0000 (23:20 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts
src/worker/WorkerSet.ts
src/worker/WorkerTypes.ts

index 3612f2818692671235bcd59384837c06e8ec8b62..6fe78d77c297b38775ea3df5d19a88cf386a9f4f 100644 (file)
@@ -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 {
index 1812d06d94455233b7573aad8d584ba1e3eccb8e..96a9901d96e5633cf85c786ab541ed98f992b67a 100644 (file)
@@ -42,6 +42,8 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
 
   get info(): SetInfo {
     return {
+      type: 'set',
+      worker: 'thread',
       size: this.size,
       elementsExecuting: [...this.workerSet].reduce(
         (accumulator, workerSetElement) => accumulator + workerSetElement.numberOfWorkerElements,
index 99ce69cd88091b3c1321592e5b2fb9ee747d16e1..7bcb108e9a5fe3c89722956e19103ed1e77d9b96 100644 (file)
@@ -9,6 +9,8 @@ export enum WorkerProcessType {
 }
 
 export type SetInfo = {
+  type: string;
+  worker: string;
   size: number;
   elementsExecuting: number;
   elementsPerWorker: number;