@nsshunt/stsrunnerframework 1.0.73 → 1.0.74
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.
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
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, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList,
|
|
12
|
+
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, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _BroadcastUpdateCommandToAllRunners, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2;
|
|
13
13
|
import { defaultLogger, Sleep, ModelDelimeter } from "@nsshunt/stsutils";
|
|
14
14
|
import { Gauge } from "@nsshunt/stsobservability";
|
|
15
15
|
const URI_BASE_VUEUTILS = "/";
|
|
@@ -2019,7 +2019,6 @@ function v4(options, buf, offset) {
|
|
|
2019
2019
|
chalk.level = 3;
|
|
2020
2020
|
class STSWorkerManager {
|
|
2021
2021
|
constructor(options) {
|
|
2022
|
-
__privateAdd(this, _STSWorkerManager_instances);
|
|
2023
2022
|
//#agentSession: string = null;
|
|
2024
2023
|
__privateAdd(this, _workersEx, {});
|
|
2025
2024
|
__privateAdd(this, _options2);
|
|
@@ -2052,7 +2051,7 @@ class STSWorkerManager {
|
|
|
2052
2051
|
await runnerEx.publishInstrumentController.EndPublish();
|
|
2053
2052
|
await Sleep(250);
|
|
2054
2053
|
}
|
|
2055
|
-
const runner =
|
|
2054
|
+
const runner = this.CreateRunnerCopy(runnerEx);
|
|
2056
2055
|
__privateGet(this, _archiveList).push(runner);
|
|
2057
2056
|
if (__privateGet(this, _archiveList).length > __privateGet(this, _options2).maxArchiveListLength) {
|
|
2058
2057
|
__privateGet(this, _archiveList).shift();
|
|
@@ -2206,7 +2205,7 @@ class STSWorkerManager {
|
|
|
2206
2205
|
});
|
|
2207
2206
|
__privateAdd(this, _SetRunnerIntoWorker, (workerEx, runnerEx) => {
|
|
2208
2207
|
const payload = {
|
|
2209
|
-
runner:
|
|
2208
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2210
2209
|
};
|
|
2211
2210
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.AddRunner, payload);
|
|
2212
2211
|
});
|
|
@@ -2346,43 +2345,43 @@ class STSWorkerManager {
|
|
|
2346
2345
|
});
|
|
2347
2346
|
__privateAdd(this, _StartRunner2, async (workerEx, runnerEx) => {
|
|
2348
2347
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StartRunner, {
|
|
2349
|
-
runner:
|
|
2348
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2350
2349
|
});
|
|
2351
2350
|
return true;
|
|
2352
2351
|
});
|
|
2353
2352
|
__privateAdd(this, _ResetRunner2, async (workerEx, runnerEx) => {
|
|
2354
2353
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResetRunner, {
|
|
2355
|
-
runner:
|
|
2354
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2356
2355
|
});
|
|
2357
2356
|
return true;
|
|
2358
2357
|
});
|
|
2359
2358
|
__privateAdd(this, _ExecuteRunner2, async (workerEx, runnerEx) => {
|
|
2360
2359
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ExecuteRunner, {
|
|
2361
|
-
runner:
|
|
2360
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2362
2361
|
});
|
|
2363
2362
|
return true;
|
|
2364
2363
|
});
|
|
2365
2364
|
__privateAdd(this, _StopRunner2, async (workerEx, runnerEx) => {
|
|
2366
2365
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StopRunner, {
|
|
2367
|
-
runner:
|
|
2366
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2368
2367
|
});
|
|
2369
2368
|
return true;
|
|
2370
2369
|
});
|
|
2371
2370
|
__privateAdd(this, _TerminateRunner2, async (workerEx, runnerEx) => {
|
|
2372
2371
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.TerminateRunner, {
|
|
2373
|
-
runner:
|
|
2372
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2374
2373
|
});
|
|
2375
2374
|
return true;
|
|
2376
2375
|
});
|
|
2377
2376
|
__privateAdd(this, _PauseRunner2, async (workerEx, runnerEx) => {
|
|
2378
2377
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.PauseRunner, {
|
|
2379
|
-
runner:
|
|
2378
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2380
2379
|
});
|
|
2381
2380
|
return true;
|
|
2382
2381
|
});
|
|
2383
2382
|
__privateAdd(this, _ResumeRunner2, async (workerEx, runnerEx) => {
|
|
2384
2383
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResumeRunner, {
|
|
2385
|
-
runner:
|
|
2384
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2386
2385
|
});
|
|
2387
2386
|
return true;
|
|
2388
2387
|
});
|
|
@@ -2464,7 +2463,7 @@ class STSWorkerManager {
|
|
|
2464
2463
|
__privateAdd(this, _UpdateOptions2, async (workerEx, runnerEx, executionProfile) => {
|
|
2465
2464
|
runnerEx.options.executionProfile = { ...executionProfile };
|
|
2466
2465
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
|
|
2467
|
-
runner:
|
|
2466
|
+
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2468
2467
|
});
|
|
2469
2468
|
return true;
|
|
2470
2469
|
});
|
|
@@ -2561,10 +2560,40 @@ class STSWorkerManager {
|
|
|
2561
2560
|
}
|
|
2562
2561
|
__privateGet(this, _processLoopExecutor2).call(this);
|
|
2563
2562
|
}
|
|
2563
|
+
CreateRunnerCopyNoHistory(runnerEx) {
|
|
2564
|
+
return {
|
|
2565
|
+
id: runnerEx.id,
|
|
2566
|
+
asyncRunnerContext: { ...runnerEx.asyncRunnerContext },
|
|
2567
|
+
instrumentData: { ...runnerEx.instrumentData },
|
|
2568
|
+
iteration: runnerEx.iteration,
|
|
2569
|
+
options: { ...runnerEx.options },
|
|
2570
|
+
state: runnerEx.state,
|
|
2571
|
+
workerId: runnerEx.workerId
|
|
2572
|
+
};
|
|
2573
|
+
}
|
|
2574
|
+
CreateRunnerCopy(runnerEx) {
|
|
2575
|
+
const retVal = this.CreateRunnerCopyNoHistory(runnerEx);
|
|
2576
|
+
if (runnerEx.runnerHistory) {
|
|
2577
|
+
retVal.runnerHistory = [...runnerEx.runnerHistory];
|
|
2578
|
+
}
|
|
2579
|
+
return retVal;
|
|
2580
|
+
}
|
|
2581
|
+
CreateWorkerCopy(workerEx) {
|
|
2582
|
+
const { id, workerThreadWorkerOptions, runnersEx } = workerEx;
|
|
2583
|
+
const workerCopy = {
|
|
2584
|
+
id,
|
|
2585
|
+
workerThreadWorkerOptions: { ...workerThreadWorkerOptions },
|
|
2586
|
+
runners: {}
|
|
2587
|
+
};
|
|
2588
|
+
for (const [, runnerEx] of Object.entries(runnersEx)) {
|
|
2589
|
+
workerCopy.runners[runnerEx.id] = this.CreateRunnerCopy(runnerEx);
|
|
2590
|
+
}
|
|
2591
|
+
return workerCopy;
|
|
2592
|
+
}
|
|
2564
2593
|
get Workers() {
|
|
2565
2594
|
const retVal = {};
|
|
2566
2595
|
for (const [, workerEx] of Object.entries(__privateGet(this, _workersEx))) {
|
|
2567
|
-
retVal[workerEx.id] =
|
|
2596
|
+
retVal[workerEx.id] = this.CreateWorkerCopy(workerEx);
|
|
2568
2597
|
}
|
|
2569
2598
|
return retVal;
|
|
2570
2599
|
}
|
|
@@ -2586,37 +2615,6 @@ _options2 = new WeakMap();
|
|
|
2586
2615
|
_STSInstrumentController = new WeakMap();
|
|
2587
2616
|
_telemetryProcessor = new WeakMap();
|
|
2588
2617
|
_archiveList = new WeakMap();
|
|
2589
|
-
_STSWorkerManager_instances = new WeakSet();
|
|
2590
|
-
CreateRunnerCopyNoHistory_fn = function(runnerEx) {
|
|
2591
|
-
return {
|
|
2592
|
-
id: runnerEx.id,
|
|
2593
|
-
asyncRunnerContext: { ...runnerEx.asyncRunnerContext },
|
|
2594
|
-
instrumentData: { ...runnerEx.instrumentData },
|
|
2595
|
-
iteration: runnerEx.iteration,
|
|
2596
|
-
options: { ...runnerEx.options },
|
|
2597
|
-
state: runnerEx.state,
|
|
2598
|
-
workerId: runnerEx.workerId
|
|
2599
|
-
};
|
|
2600
|
-
};
|
|
2601
|
-
CreateRunnerCopy_fn = function(runnerEx) {
|
|
2602
|
-
const retVal = __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopyNoHistory_fn).call(this, runnerEx);
|
|
2603
|
-
if (runnerEx.runnerHistory) {
|
|
2604
|
-
retVal.runnerHistory = [...runnerEx.runnerHistory];
|
|
2605
|
-
}
|
|
2606
|
-
return retVal;
|
|
2607
|
-
};
|
|
2608
|
-
CreateWorkerCopy_fn = function(workerEx) {
|
|
2609
|
-
const { id, workerThreadWorkerOptions, runnersEx } = workerEx;
|
|
2610
|
-
const workerCopy = {
|
|
2611
|
-
id,
|
|
2612
|
-
workerThreadWorkerOptions: { ...workerThreadWorkerOptions },
|
|
2613
|
-
runners: {}
|
|
2614
|
-
};
|
|
2615
|
-
for (const [, runnerEx] of Object.entries(runnersEx)) {
|
|
2616
|
-
workerCopy.runners[runnerEx.id] = __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx);
|
|
2617
|
-
}
|
|
2618
|
-
return workerCopy;
|
|
2619
|
-
};
|
|
2620
2618
|
_processLoopExecutor2 = new WeakMap();
|
|
2621
2619
|
_debug2 = new WeakMap();
|
|
2622
2620
|
_SetRunnerIntoWorker = new WeakMap();
|