From 059f35a55515a998352f621e40a1e35bd22b424d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 25 Jan 2021 23:03:56 +0100 Subject: [PATCH] Display worker process mode at startup. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/start.ts | 2 +- src/utils/Utils.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/start.ts b/src/start.ts index 5aaeea9f..03bd4b8b 100644 --- a/src/start.ts +++ b/src/start.ts @@ -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 diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 8ea05765..02164b1d 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -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; + } } -- 2.34.1