@nsshunt/ststestrunner 1.1.75 → 1.1.77

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.
@@ -31,6 +31,7 @@ var TestCaseFhirBase = class {
31
31
  #resetSocketClientTrigger = 50;
32
32
  #clientSocketFetchCount = 0;
33
33
  #authAgentManager;
34
+ runnerDurationList = [];
34
35
  _authMaxTimeout = 5e3;
35
36
  accessTokenTime = performance.now();
36
37
  newTokenLimitTime = 30;
@@ -221,7 +222,22 @@ var TestCaseFhirBase = class {
221
222
  process.nextTick(resolve);
222
223
  });
223
224
  }
225
+ #CalculatePercentile = () => {
226
+ this.runnerDurationList.sort((a, b) => a - b);
227
+ const size = this.runnerDurationList.length;
228
+ const _GetP = (factor) => {
229
+ const pos = Math.floor(size * factor);
230
+ if (pos >= 0 && pos < size) return this.runnerDurationList[pos];
231
+ else return -1;
232
+ };
233
+ this.#runner.instrumentData.perc["50"] = _GetP(.5);
234
+ this.#runner.instrumentData.perc["80"] = _GetP(.8);
235
+ this.#runner.instrumentData.perc["90"] = _GetP(.9);
236
+ this.#runner.instrumentData.perc["95"] = _GetP(.95);
237
+ this.#runner.instrumentData.perc["98"] = _GetP(.98);
238
+ };
224
239
  #PublishTelemetryData = async () => {
240
+ this.#CalculatePercentile();
225
241
  this.#runnerExecutionWorker.PostTelemetryById(this.#runner.id);
226
242
  this.#runner.instrumentData.velocity = 0;
227
243
  this.#runner.instrumentData.message = [];
@@ -459,6 +475,7 @@ var TestCaseFhirBase = class {
459
475
  };
460
476
  StartRunner = async () => {
461
477
  this.runner.instrumentData.timer = performance.now();
478
+ this.runnerDurationList = [];
462
479
  await this.#OutputLogMessage(`StartRunner [${this.#runner.id}]`);
463
480
  await this.#ForcePublishTelemetryData();
464
481
  return true;
@@ -505,6 +522,7 @@ var TestCaseFhirBase = class {
505
522
  //#region src/libmodule/testCaseFhirQueryBase.ts
506
523
  var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
507
524
  _longExecTimeoutVal = 5e3;
525
+ _durationList = [];
508
526
  constructor(workerInstance, runner) {
509
527
  super(workerInstance, runner);
510
528
  }