@nsshunt/stsrunnerframework 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
13
13
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
14
14
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
15
15
|
|
|
16
|
-
var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _STSWorkerManager_instances, GetRunnersResponse_fn, _PostMessageToWorkerGetRunners;
|
|
16
|
+
var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _STSWorkerManager_instances, GetRunnersResponse_fn, _SyncRunnerData, _SyncWorkerDataFromPayload, _SyncWorkerDataFromWorker, _SyncWorkerDataFromWorkers, _PostMessageToWorkerGetRunners;
|
|
17
17
|
const URI_BASE_VUEUTILS = "/";
|
|
18
18
|
const STS_RF_RES_PREFIX = "STS_R_RF_";
|
|
19
19
|
const STS_RF_RES_ENT_PREFIX = "STS_RE_RF_";
|
|
@@ -2279,7 +2279,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2279
2279
|
__privateAdd(this, _debug2, (message) => {
|
|
2280
2280
|
console.log(chalk.cyan(`pid: [${process.pid}] STSWorkerManager::${message}`));
|
|
2281
2281
|
});
|
|
2282
|
-
__publicField(this, "GetWorkers", () => {
|
|
2282
|
+
__publicField(this, "GetWorkers", async () => {
|
|
2283
|
+
await __privateGet(this, _SyncWorkerDataFromWorkers).call(this);
|
|
2283
2284
|
const retVal = {};
|
|
2284
2285
|
for (const [, workerEx] of Object.entries(__privateGet(this, _workersEx))) {
|
|
2285
2286
|
retVal[workerEx.id] = this.CreateWorkerCopy(workerEx);
|
|
@@ -2289,10 +2290,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2289
2290
|
__publicField(this, "GetArchiveList", () => {
|
|
2290
2291
|
return __privateGet(this, _archiveList);
|
|
2291
2292
|
});
|
|
2292
|
-
__publicField(this, "GetWorker", (workerId) => {
|
|
2293
|
+
__publicField(this, "GetWorker", async (workerId) => {
|
|
2294
|
+
await __privateGet(this, _SyncWorkerDataFromWorker).call(this, __privateGet(this, _workersEx)[workerId]);
|
|
2293
2295
|
return this.CreateWorkerCopy(__privateGet(this, _workersEx)[workerId]);
|
|
2294
2296
|
});
|
|
2295
|
-
__publicField(this, "GetRunner", (workerId, runnerId) => {
|
|
2297
|
+
__publicField(this, "GetRunner", async (workerId, runnerId) => {
|
|
2298
|
+
await __privateGet(this, _SyncWorkerDataFromWorker).call(this, __privateGet(this, _workersEx)[workerId]);
|
|
2296
2299
|
return this.CreateRunnerCopy(__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]);
|
|
2297
2300
|
});
|
|
2298
2301
|
__publicField(this, "AddWorker", (workerOptions, useWorkerFactory) => {
|
|
@@ -2318,7 +2321,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2318
2321
|
options: workerOptions,
|
|
2319
2322
|
runnersEx: {},
|
|
2320
2323
|
runnersEvents: {},
|
|
2321
|
-
GetRunner: (id) => __privateGet(this, _workersEx)[workerId].
|
|
2324
|
+
GetRunner: (id) => __privateGet(this, _workersEx)[workerId].runnersEx[id],
|
|
2322
2325
|
// Commands to execute on individual runners
|
|
2323
2326
|
AddRunner: (runnerOptions) => this.AddRunnerToWorker(stsWorkerEx, runnerOptions),
|
|
2324
2327
|
StartRunner: (runner) => __privateGet(this, _StartRunner2).call(this, stsWorkerEx, runner),
|
|
@@ -2477,12 +2480,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2477
2480
|
const { runner } = payloadContents;
|
|
2478
2481
|
if (workerEx.runnersEx[runner.id]) {
|
|
2479
2482
|
const runnerEx = workerEx.runnersEx[runner.id];
|
|
2480
|
-
|
|
2481
|
-
if (runner.instrumentData.message) {
|
|
2482
|
-
runnerEx.instrumentData.message = [...runner.instrumentData.message];
|
|
2483
|
-
} else {
|
|
2484
|
-
runnerEx.instrumentData.message = [];
|
|
2485
|
-
}
|
|
2483
|
+
__privateGet(this, _SyncRunnerData).call(this, runnerEx, runner);
|
|
2486
2484
|
if (runnerEx.publishInstrumentController && __privateGet(this, _telemetryProcessor)) {
|
|
2487
2485
|
__privateGet(this, _telemetryProcessor).ProcessTelemetry(runnerEx.publishInstrumentController, runnerEx.instrumentData);
|
|
2488
2486
|
}
|
|
@@ -2521,8 +2519,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2521
2519
|
eventDate: /* @__PURE__ */ new Date(),
|
|
2522
2520
|
runner: { ...runner }
|
|
2523
2521
|
});
|
|
2524
|
-
|
|
2525
|
-
runnerEx.iteration = runner.iteration;
|
|
2522
|
+
__privateGet(this, _SyncRunnerData).call(this, runnerEx, runner);
|
|
2526
2523
|
__privateGet(this, _debug2).call(this, `STSWorkerManager:#RunnerStateChange(): Worker: [${workerEx.id}] Runner: [${runner.id}]`);
|
|
2527
2524
|
__privateGet(this, _debug2).call(this, `STSWorkerManager:#RunnerStateChange(): --> Runner iteration (payload): [${runner.iteration}]`);
|
|
2528
2525
|
__privateGet(this, _debug2).call(this, `STSWorkerManager:#RunnerStateChange(): --> Runner instrumentData.requestCount (payload): [${runner.instrumentData.requestCount}]`);
|
|
@@ -2838,16 +2835,26 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2838
2835
|
__publicField(this, "UpdateAllWorkers", (options) => {
|
|
2839
2836
|
return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
|
|
2840
2837
|
});
|
|
2841
|
-
|
|
2838
|
+
__privateAdd(this, _SyncRunnerData, (runnerEx, runner) => {
|
|
2839
|
+
runnerEx.iteration = runner.iteration;
|
|
2840
|
+
runnerEx.state = runner.state;
|
|
2841
|
+
runnerEx.instrumentData = { ...runner.instrumentData };
|
|
2842
|
+
});
|
|
2843
|
+
__privateAdd(this, _SyncWorkerDataFromPayload, (payload) => {
|
|
2844
|
+
const runnersEx = __privateGet(this, _workersEx)[payload.workerId].runnersEx;
|
|
2845
|
+
payload.runners.forEach((runner) => {
|
|
2846
|
+
__privateGet(this, _SyncRunnerData).call(this, runnersEx[runner.id], runner);
|
|
2847
|
+
});
|
|
2848
|
+
});
|
|
2849
|
+
__privateAdd(this, _SyncWorkerDataFromWorker, async (workerEx) => {
|
|
2850
|
+
const retVal = await __privateGet(this, _PostMessageToWorkerGetRunners).call(this, workerEx, eIWMessageCommands.GetRunners);
|
|
2851
|
+
__privateGet(this, _SyncWorkerDataFromPayload).call(this, retVal.payload);
|
|
2852
|
+
return retVal;
|
|
2853
|
+
});
|
|
2854
|
+
__privateAdd(this, _SyncWorkerDataFromWorkers, async () => {
|
|
2842
2855
|
const retVal = await Promise.all(Object.values(__privateGet(this, _workersEx)).map((workerEx) => __privateGet(this, _PostMessageToWorkerGetRunners).call(this, workerEx, eIWMessageCommands.GetRunners)));
|
|
2843
2856
|
retVal.forEach((messagePayload) => {
|
|
2844
|
-
|
|
2845
|
-
const runnersEx = __privateGet(this, _workersEx)[payload.workerId].runnersEx;
|
|
2846
|
-
payload.runners.forEach((runner) => {
|
|
2847
|
-
runnersEx[runner.id].iteration = runner.iteration;
|
|
2848
|
-
runnersEx[runner.id].state = runner.state;
|
|
2849
|
-
runnersEx[runner.id].instrumentData = { ...runner.instrumentData };
|
|
2850
|
-
});
|
|
2857
|
+
__privateGet(this, _SyncWorkerDataFromPayload).call(this, messagePayload.payload);
|
|
2851
2858
|
});
|
|
2852
2859
|
return retVal;
|
|
2853
2860
|
});
|
|
@@ -2993,6 +3000,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2993
3000
|
console.error(`#GetRunnersResponse(): Error: [${error}]`);
|
|
2994
3001
|
}
|
|
2995
3002
|
};
|
|
3003
|
+
_SyncRunnerData = new WeakMap();
|
|
3004
|
+
_SyncWorkerDataFromPayload = new WeakMap();
|
|
3005
|
+
_SyncWorkerDataFromWorker = new WeakMap();
|
|
3006
|
+
_SyncWorkerDataFromWorkers = new WeakMap();
|
|
2996
3007
|
_PostMessageToWorkerGetRunners = new WeakMap();
|
|
2997
3008
|
exports2.IRunnerState = IRunnerState;
|
|
2998
3009
|
exports2.IWorkerState = IWorkerState;
|