Move workers handling code in its own directory.
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 24 Jan 2021 21:12:13 +0000 (22:12 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 24 Jan 2021 21:12:53 +0000 (22:12 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/start.ts
src/worker/Worker.ts [moved from src/charging-station/Worker.ts with 100% similarity]
src/worker/WorkerGroup.ts [moved from src/charging-station/WorkerGroup.ts with 100% similarity]
src/worker/WorkerPool.ts [moved from src/charging-station/WorkerPool.ts with 100% similarity]

index f316d0ad3d2ef6ea88090a87f71c511a69439346..591ef96f0b6d186ede5a40053b7d1a466f3611a7 100644 (file)
@@ -2,8 +2,8 @@ import Configuration from './utils/Configuration';
 import Constants from './utils/Constants';
 import Utils from './utils/Utils';
 import WorkerData from './types/WorkerData';
-import WorkerGroup from './charging-station/WorkerGroup';
-import WorkerPool from './charging-station/WorkerPool';
+import WorkerGroup from './worker/WorkerGroup';
+import WorkerPool from './worker/WorkerPool';
 
 class Bootstrap {
   static async start() {
@@ -61,9 +61,9 @@ class Bootstrap {
       if (numStationsTotal === 0) {
         console.log('No charging station template enabled in configuration, exiting');
       } else if (Configuration.useWorkerPool()) {
-        console.log('Charging station simulator started with ' + numStationsTotal.toString() + ' charging station(s) and ' + numConcurrentWorkers.toString() + '/' + Configuration.getWorkerPoolMaxSize().toString() + ' worker(s) concurrently running');
+        console.log(`Charging station simulator started with ${numStationsTotal.toString()} charging station(s) and ${numConcurrentWorkers.toString()}/${Configuration.getWorkerPoolMaxSize().toString()} worker(s) concurrently running`);
       } else {
-        console.log('Charging station simulator started with ' + numStationsTotal.toString() + ' charging station(s) and ' + numConcurrentWorkers.toString() + ' worker(s) concurrently running');
+        console.log(`Charging station simulator started with ${numStationsTotal.toString()} charging station(s) and ${numConcurrentWorkers.toString()} worker(s) concurrently running (${chargingStationsPerWorker} charging station(s) per worker)`);
       }
     } catch (error) {
       // eslint-disable-next-line no-console