Display worker process mode at startup.
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 25 Jan 2021 22:03:56 +0000 (23:03 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 25 Jan 2021 22:03:56 +0000 (23:03 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/start.ts
src/utils/Utils.ts

index 5aaeea9f940235ba0641122e8da86e91ae7f4529..03bd4b8b03d41cbb3fd7a0787f0e8f082a7770ba 100644 (file)
@@ -34,7 +34,7 @@ class Bootstrap {
       if (numStationsTotal === 0) {
         console.log('No charging station template enabled in configuration, exiting');
       } else {
-        console.log(`Charging station simulator started with ${numStationsTotal.toString()} charging station(s) and ${workerImplementation.size}${Utils.workerPoolInUse() ? `/${Configuration.getWorkerPoolMaxSize().toString()}` : ''} worker(s) concurrently running (${workerImplementation.maxElementsPerWorker} charging station(s) per worker)`);
+        console.log(`Charging station simulator started with ${numStationsTotal.toString()} charging station(s) and ${Utils.workerDynamicPoolInUse() ? `${Configuration.getWorkerPoolMinSize().toString()}/` : ''}${workerImplementation.size}${Utils.workerPoolInUse() ? `/${Configuration.getWorkerPoolMaxSize().toString()}` : ''} worker(s) concurrently running in '${Configuration.getWorkerProcess()}' mode (${workerImplementation.maxElementsPerWorker} charging station(s) per worker)`);
       }
     } catch (error) {
       // eslint-disable-next-line no-console
index 8ea05765f5c3e530329814d81bcdfd0310b800d4..02164b1d3be956ec4edb9e1a537d624ba7b725bf 100644 (file)
@@ -215,4 +215,8 @@ export default class Utils {
   static workerPoolInUse(): boolean {
     return Configuration.getWorkerProcess() === WorkerProcessType.DYNAMIC_POOL || Configuration.getWorkerProcess() === WorkerProcessType.STATIC_POOL;
   }
+
+  static workerDynamicPoolInUse(): boolean {
+    return Configuration.getWorkerProcess() === WorkerProcessType.DYNAMIC_POOL;
+  }
 }