From: Jérôme Benoit Date: Mon, 25 Jan 2021 22:03:56 +0000 (+0100) Subject: Display worker process mode at startup. X-Git-Tag: v1.0.1-0~110 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=059f35a55515a998352f621e40a1e35bd22b424d;p=e-mobility-charging-stations-simulator.git Display worker process mode at startup. Signed-off-by: Jérôme Benoit --- 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; + } }