@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.
@@ -569,6 +569,15 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
569
569
  _GetDetail = () => {
570
570
  return `testType: [${this.runner.options.testType}], description: [${this.runner.options.description}], workerManagerId: [${this.runner.workerManagerId}], Iteration: [${this.runner.iteration}]`;
571
571
  };
572
+ _CheckOutputLongDurationError = (snapshotStart, message) => {
573
+ const snapShotEnd = performance.now();
574
+ if (snapShotEnd - snapshotStart > 1e3) {
575
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): *** ==> Long execution: [${snapShotEnd - snapshotStart}] message: [${message}]`));
576
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> ${this._GetDetail()}`));
577
+ this.Error(chalk.default.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> Note: While not specifically an error, this is logged as an error.`));
578
+ }
579
+ return snapShotEnd;
580
+ };
572
581
  ExecuteRunner = async () => {
573
582
  if (this.runner.iteration % 100 === 0) this.Debug(`TestCaseFhirQueryBase:ExecuteRunner(): ${this._GetDetail()}`);
574
583
  const start = performance.now();
@@ -594,6 +603,7 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
594
603
  this.runner.instrumentData.activeRequestCount--;
595
604
  const diff = performance.now() - start;
596
605
  this.runner.instrumentData.duration = diff;
606
+ this.runnerDurationList.push(diff);
597
607
  if (diff <= 5) this.runner.instrumentData.duration5++;
598
608
  else if (diff <= 10) this.runner.instrumentData.duration10++;
599
609
  else if (diff <= 20) this.runner.instrumentData.duration20++;
@@ -628,7 +638,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
628
638
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
629
639
  ExecuteQuery = async () => {
630
640
  try {
641
+ const __snapshot1 = performance.now();
631
642
  await this.GetAccessToken();
643
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
632
644
  this.accesssToken = null;
633
645
  return null;
634
646
  } catch (error) {
@@ -643,10 +655,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
643
655
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
644
656
  ExecuteQuery = async () => {
645
657
  try {
658
+ const __snapshot1 = performance.now();
646
659
  const client = await this.GetClient();
660
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
647
661
  const prefix = this.runner.options.personPrefix;
648
662
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
649
- return (await client.PostResource("Person", personRecord)).body;
663
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
664
+ const retVal = await client.PostResource("Person", personRecord);
665
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
666
+ return retVal.body;
650
667
  } catch (error) {
651
668
  this.runner.instrumentData.errorCount++;
652
669
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -659,9 +676,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
659
676
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
660
677
  ExecuteQuery = async () => {
661
678
  try {
679
+ const __snapshot1 = performance.now();
662
680
  const client = await this.GetClient();
681
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
663
682
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
683
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
664
684
  const retVal = await client.GetResource("Person", personRecord.id);
685
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
665
686
  delete personRecord.meta;
666
687
  delete retVal.body.meta;
667
688
  const p1 = JSON.stringify(personRecord);
@@ -680,9 +701,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
680
701
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
681
702
  ExecuteQuery = async () => {
682
703
  try {
704
+ const __snapshot1 = performance.now();
683
705
  const client = await this.GetClient();
706
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
684
707
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
708
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
685
709
  const retVal = await client.GetResource("Person", personRecord.id);
710
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
686
711
  this.runner.instrumentData.requestCount++;
687
712
  const compPersonRecord = { ...personRecord };
688
713
  const loadedPersonRecorded = { ...retVal.body };
@@ -698,6 +723,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
698
723
  if (originalPersonRecord && originalPersonRecord.text) {
699
724
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
700
725
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
726
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
701
727
  const updatedRecord = { ...retVal.body };
702
728
  delete updatedRecord.meta;
703
729
  delete originalPersonRecord.meta;
@@ -721,11 +747,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
721
747
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
722
748
  ExecuteQuery = async () => {
723
749
  try {
750
+ const __snapshot1 = performance.now();
724
751
  const client = await this.GetClient();
752
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
725
753
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
754
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
726
755
  if (originalPersonRecord && originalPersonRecord.text) {
727
756
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
728
757
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
758
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
729
759
  const updatedRecord = { ...retVal.body };
730
760
  delete updatedRecord.meta;
731
761
  delete originalPersonRecord.meta;
@@ -749,11 +779,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
749
779
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
750
780
  ExecuteQuery = async () => {
751
781
  try {
782
+ const __snapshot1 = performance.now();
752
783
  const client = await this.GetClient();
784
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
753
785
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
754
786
  const prefix = this.runner.options.personPrefix;
755
787
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
756
- performance.now();
788
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
757
789
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
758
790
  let retVal;
759
791
  if (this.runner.options.useDirectQuery === true) {
@@ -762,8 +794,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
762
794
  family: personRecord.name[0].family
763
795
  };
764
796
  retVal = await client.GenericSearchTesting("Person", data);
765
- } else retVal = await client.GetResources(url);
766
- performance.now();
797
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
798
+ } else {
799
+ retVal = await client.GetResources(url);
800
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
801
+ }
767
802
  return retVal.body;
768
803
  } catch (error) {
769
804
  this.runner.instrumentData.errorCount++;
@@ -1424,13 +1459,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1424
1459
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1425
1460
  ExecuteQuery = async () => {
1426
1461
  try {
1462
+ const __snapshot1 = performance.now();
1427
1463
  const client = await this.GetClient();
1464
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1428
1465
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1429
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1466
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1467
+ const retVal = await client.GetResource("Person", personRecord.id);
1468
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1469
+ const resource = retVal.body;
1430
1470
  const observer = fast_json_patch_default.observe(resource);
1431
1471
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1432
1472
  const patchRecord = fast_json_patch_default.generate(observer);
1433
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1473
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1474
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1475
+ return retValPatched.body;
1434
1476
  } catch (error) {
1435
1477
  this.runner.instrumentData.errorCount++;
1436
1478
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1443,11 +1485,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1443
1485
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1444
1486
  ExecuteQuery = async () => {
1445
1487
  try {
1488
+ const __snapshot1 = performance.now();
1446
1489
  const client = await this.GetClient();
1490
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1447
1491
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1448
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1492
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1493
+ const retVal = await client.GetResource("Person", personRecord.id);
1494
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1495
+ const resource = retVal.body;
1449
1496
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1450
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1497
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1498
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1499
+ return retValPatched.body;
1451
1500
  } catch (error) {
1452
1501
  this.runner.instrumentData.errorCount++;
1453
1502
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1460,10 +1509,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1460
1509
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1461
1510
  ExecuteQuery = async () => {
1462
1511
  try {
1512
+ const __snapshot1 = performance.now();
1463
1513
  const client = await this.GetClient();
1514
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1464
1515
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1465
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1466
- else {
1516
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1517
+ if (personRecord.text) {
1518
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1519
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1520
+ return retVal.body;
1521
+ } else {
1467
1522
  this.runner.instrumentData.errorCount++;
1468
1523
  return null;
1469
1524
  }
@@ -1479,9 +1534,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1479
1534
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1480
1535
  ExecuteQuery = async () => {
1481
1536
  try {
1537
+ const __snapshot1 = performance.now();
1482
1538
  const client = await this.GetClient();
1539
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1483
1540
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1484
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1541
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1542
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1543
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1544
+ return retVal.body;
1485
1545
  } catch (error) {
1486
1546
  this.runner.instrumentData.errorCount++;
1487
1547
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);