@nsshunt/ststestrunner 1.1.77 → 1.1.79

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.
@@ -546,6 +546,15 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
546
546
  _GetDetail = () => {
547
547
  return `testType: [${this.runner.options.testType}], description: [${this.runner.options.description}], workerManagerId: [${this.runner.workerManagerId}], Iteration: [${this.runner.iteration}]`;
548
548
  };
549
+ _CheckOutputLongDurationError = (snapshotStart, message) => {
550
+ const snapShotEnd = performance.now();
551
+ if (snapShotEnd - snapshotStart > 1e3) {
552
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): *** ==> Long execution: [${snapShotEnd - snapshotStart}] message: [${message}]`));
553
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> ${this._GetDetail()}`));
554
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> Note: While not specifically an error, this is logged as an error.`));
555
+ }
556
+ return snapShotEnd;
557
+ };
549
558
  ExecuteRunner = async () => {
550
559
  if (this.runner.iteration % 100 === 0) this.Debug(`TestCaseFhirQueryBase:ExecuteRunner(): ${this._GetDetail()}`);
551
560
  const start = performance.now();
@@ -571,6 +580,7 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
571
580
  this.runner.instrumentData.activeRequestCount--;
572
581
  const diff = performance.now() - start;
573
582
  this.runner.instrumentData.duration = diff;
583
+ this.runnerDurationList.push(diff);
574
584
  if (diff <= 5) this.runner.instrumentData.duration5++;
575
585
  else if (diff <= 10) this.runner.instrumentData.duration10++;
576
586
  else if (diff <= 20) this.runner.instrumentData.duration20++;
@@ -605,7 +615,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
605
615
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
606
616
  ExecuteQuery = async () => {
607
617
  try {
618
+ const __snapshot1 = performance.now();
608
619
  await this.GetAccessToken();
620
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
609
621
  this.accesssToken = null;
610
622
  return null;
611
623
  } catch (error) {
@@ -620,10 +632,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
620
632
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
621
633
  ExecuteQuery = async () => {
622
634
  try {
635
+ const __snapshot1 = performance.now();
623
636
  const client = await this.GetClient();
637
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
624
638
  const prefix = this.runner.options.personPrefix;
625
639
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
626
- return (await client.PostResource("Person", personRecord)).body;
640
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
641
+ const retVal = await client.PostResource("Person", personRecord);
642
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
643
+ return retVal.body;
627
644
  } catch (error) {
628
645
  this.runner.instrumentData.errorCount++;
629
646
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -636,9 +653,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
636
653
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
637
654
  ExecuteQuery = async () => {
638
655
  try {
656
+ const __snapshot1 = performance.now();
639
657
  const client = await this.GetClient();
658
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
640
659
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
660
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
641
661
  const retVal = await client.GetResource("Person", personRecord.id);
662
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
642
663
  delete personRecord.meta;
643
664
  delete retVal.body.meta;
644
665
  const p1 = JSON.stringify(personRecord);
@@ -657,9 +678,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
657
678
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
658
679
  ExecuteQuery = async () => {
659
680
  try {
681
+ const __snapshot1 = performance.now();
660
682
  const client = await this.GetClient();
683
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
661
684
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
685
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
662
686
  const retVal = await client.GetResource("Person", personRecord.id);
687
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
663
688
  this.runner.instrumentData.requestCount++;
664
689
  const compPersonRecord = { ...personRecord };
665
690
  const loadedPersonRecorded = { ...retVal.body };
@@ -675,6 +700,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
675
700
  if (originalPersonRecord && originalPersonRecord.text) {
676
701
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
677
702
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
703
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
678
704
  const updatedRecord = { ...retVal.body };
679
705
  delete updatedRecord.meta;
680
706
  delete originalPersonRecord.meta;
@@ -698,11 +724,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
698
724
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
699
725
  ExecuteQuery = async () => {
700
726
  try {
727
+ const __snapshot1 = performance.now();
701
728
  const client = await this.GetClient();
729
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
702
730
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
731
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
703
732
  if (originalPersonRecord && originalPersonRecord.text) {
704
733
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
705
734
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
735
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
706
736
  const updatedRecord = { ...retVal.body };
707
737
  delete updatedRecord.meta;
708
738
  delete originalPersonRecord.meta;
@@ -726,11 +756,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
726
756
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
727
757
  ExecuteQuery = async () => {
728
758
  try {
759
+ const __snapshot1 = performance.now();
729
760
  const client = await this.GetClient();
761
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
730
762
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
731
763
  const prefix = this.runner.options.personPrefix;
732
764
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
733
- performance.now();
765
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
734
766
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
735
767
  let retVal;
736
768
  if (this.runner.options.useDirectQuery === true) {
@@ -739,8 +771,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
739
771
  family: personRecord.name[0].family
740
772
  };
741
773
  retVal = await client.GenericSearchTesting("Person", data);
742
- } else retVal = await client.GetResources(url);
743
- performance.now();
774
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
775
+ } else {
776
+ retVal = await client.GetResources(url);
777
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
778
+ }
744
779
  return retVal.body;
745
780
  } catch (error) {
746
781
  this.runner.instrumentData.errorCount++;
@@ -1401,13 +1436,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1401
1436
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1402
1437
  ExecuteQuery = async () => {
1403
1438
  try {
1439
+ const __snapshot1 = performance.now();
1404
1440
  const client = await this.GetClient();
1441
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1405
1442
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1406
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1443
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1444
+ const retVal = await client.GetResource("Person", personRecord.id);
1445
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1446
+ const resource = retVal.body;
1407
1447
  const observer = fast_json_patch_default.observe(resource);
1408
1448
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1409
1449
  const patchRecord = fast_json_patch_default.generate(observer);
1410
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1450
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1451
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1452
+ return retValPatched.body;
1411
1453
  } catch (error) {
1412
1454
  this.runner.instrumentData.errorCount++;
1413
1455
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1420,11 +1462,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1420
1462
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1421
1463
  ExecuteQuery = async () => {
1422
1464
  try {
1465
+ const __snapshot1 = performance.now();
1423
1466
  const client = await this.GetClient();
1467
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1424
1468
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1425
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1469
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1470
+ const retVal = await client.GetResource("Person", personRecord.id);
1471
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1472
+ const resource = retVal.body;
1426
1473
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1427
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1474
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1475
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1476
+ return retValPatched.body;
1428
1477
  } catch (error) {
1429
1478
  this.runner.instrumentData.errorCount++;
1430
1479
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1437,10 +1486,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1437
1486
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1438
1487
  ExecuteQuery = async () => {
1439
1488
  try {
1489
+ const __snapshot1 = performance.now();
1440
1490
  const client = await this.GetClient();
1491
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1441
1492
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1442
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1443
- else {
1493
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1494
+ if (personRecord.text) {
1495
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1496
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1497
+ return retVal.body;
1498
+ } else {
1444
1499
  this.runner.instrumentData.errorCount++;
1445
1500
  return null;
1446
1501
  }
@@ -1456,9 +1511,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1456
1511
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1457
1512
  ExecuteQuery = async () => {
1458
1513
  try {
1514
+ const __snapshot1 = performance.now();
1459
1515
  const client = await this.GetClient();
1516
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1460
1517
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1461
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1518
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1519
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1520
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1521
+ return retVal.body;
1462
1522
  } catch (error) {
1463
1523
  this.runner.instrumentData.errorCount++;
1464
1524
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);