@nsshunt/ststestrunner 1.1.78 → 1.1.80

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();
@@ -599,8 +608,12 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
599
608
  else if (diff <= 10) this.runner.instrumentData.duration10++;
600
609
  else if (diff <= 20) this.runner.instrumentData.duration20++;
601
610
  else if (diff <= 30) this.runner.instrumentData.duration30++;
611
+ else if (diff <= 40) this.runner.instrumentData.duration40++;
602
612
  else if (diff <= 50) this.runner.instrumentData.duration50++;
613
+ else if (diff <= 60) this.runner.instrumentData.duration60++;
614
+ else if (diff <= 80) this.runner.instrumentData.duration80++;
603
615
  else if (diff <= 100) this.runner.instrumentData.duration100++;
616
+ else if (diff <= 120) this.runner.instrumentData.duration120++;
604
617
  else if (diff <= 150) this.runner.instrumentData.duration150++;
605
618
  else if (diff <= 250) this.runner.instrumentData.duration250++;
606
619
  else if (diff <= 500) this.runner.instrumentData.duration500++;
@@ -629,7 +642,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
629
642
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
630
643
  ExecuteQuery = async () => {
631
644
  try {
645
+ const __snapshot1 = performance.now();
632
646
  await this.GetAccessToken();
647
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
633
648
  this.accesssToken = null;
634
649
  return null;
635
650
  } catch (error) {
@@ -644,10 +659,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
644
659
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
645
660
  ExecuteQuery = async () => {
646
661
  try {
662
+ const __snapshot1 = performance.now();
647
663
  const client = await this.GetClient();
664
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
648
665
  const prefix = this.runner.options.personPrefix;
649
666
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
650
- return (await client.PostResource("Person", personRecord)).body;
667
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
668
+ const retVal = await client.PostResource("Person", personRecord);
669
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
670
+ return retVal.body;
651
671
  } catch (error) {
652
672
  this.runner.instrumentData.errorCount++;
653
673
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -660,9 +680,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
660
680
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
661
681
  ExecuteQuery = async () => {
662
682
  try {
683
+ const __snapshot1 = performance.now();
663
684
  const client = await this.GetClient();
685
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
664
686
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
687
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
665
688
  const retVal = await client.GetResource("Person", personRecord.id);
689
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
666
690
  delete personRecord.meta;
667
691
  delete retVal.body.meta;
668
692
  const p1 = JSON.stringify(personRecord);
@@ -681,9 +705,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
681
705
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
682
706
  ExecuteQuery = async () => {
683
707
  try {
708
+ const __snapshot1 = performance.now();
684
709
  const client = await this.GetClient();
710
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
685
711
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
712
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
686
713
  const retVal = await client.GetResource("Person", personRecord.id);
714
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
687
715
  this.runner.instrumentData.requestCount++;
688
716
  const compPersonRecord = { ...personRecord };
689
717
  const loadedPersonRecorded = { ...retVal.body };
@@ -699,6 +727,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
699
727
  if (originalPersonRecord && originalPersonRecord.text) {
700
728
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
701
729
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
730
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
702
731
  const updatedRecord = { ...retVal.body };
703
732
  delete updatedRecord.meta;
704
733
  delete originalPersonRecord.meta;
@@ -722,11 +751,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
722
751
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
723
752
  ExecuteQuery = async () => {
724
753
  try {
754
+ const __snapshot1 = performance.now();
725
755
  const client = await this.GetClient();
756
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
726
757
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
758
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
727
759
  if (originalPersonRecord && originalPersonRecord.text) {
728
760
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
729
761
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
762
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
730
763
  const updatedRecord = { ...retVal.body };
731
764
  delete updatedRecord.meta;
732
765
  delete originalPersonRecord.meta;
@@ -750,11 +783,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
750
783
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
751
784
  ExecuteQuery = async () => {
752
785
  try {
786
+ const __snapshot1 = performance.now();
753
787
  const client = await this.GetClient();
788
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
754
789
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
755
790
  const prefix = this.runner.options.personPrefix;
756
791
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
757
- performance.now();
792
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
758
793
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
759
794
  let retVal;
760
795
  if (this.runner.options.useDirectQuery === true) {
@@ -763,8 +798,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
763
798
  family: personRecord.name[0].family
764
799
  };
765
800
  retVal = await client.GenericSearchTesting("Person", data);
766
- } else retVal = await client.GetResources(url);
767
- performance.now();
801
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
802
+ } else {
803
+ retVal = await client.GetResources(url);
804
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
805
+ }
768
806
  return retVal.body;
769
807
  } catch (error) {
770
808
  this.runner.instrumentData.errorCount++;
@@ -1425,13 +1463,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1425
1463
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1426
1464
  ExecuteQuery = async () => {
1427
1465
  try {
1466
+ const __snapshot1 = performance.now();
1428
1467
  const client = await this.GetClient();
1468
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1429
1469
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1430
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1470
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1471
+ const retVal = await client.GetResource("Person", personRecord.id);
1472
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1473
+ const resource = retVal.body;
1431
1474
  const observer = fast_json_patch_default.observe(resource);
1432
1475
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1433
1476
  const patchRecord = fast_json_patch_default.generate(observer);
1434
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1477
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1478
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1479
+ return retValPatched.body;
1435
1480
  } catch (error) {
1436
1481
  this.runner.instrumentData.errorCount++;
1437
1482
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1444,11 +1489,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1444
1489
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1445
1490
  ExecuteQuery = async () => {
1446
1491
  try {
1492
+ const __snapshot1 = performance.now();
1447
1493
  const client = await this.GetClient();
1494
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1448
1495
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1449
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1496
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1497
+ const retVal = await client.GetResource("Person", personRecord.id);
1498
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1499
+ const resource = retVal.body;
1450
1500
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1451
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1501
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1502
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1503
+ return retValPatched.body;
1452
1504
  } catch (error) {
1453
1505
  this.runner.instrumentData.errorCount++;
1454
1506
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1461,10 +1513,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1461
1513
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1462
1514
  ExecuteQuery = async () => {
1463
1515
  try {
1516
+ const __snapshot1 = performance.now();
1464
1517
  const client = await this.GetClient();
1518
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1465
1519
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1466
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1467
- else {
1520
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1521
+ if (personRecord.text) {
1522
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1523
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1524
+ return retVal.body;
1525
+ } else {
1468
1526
  this.runner.instrumentData.errorCount++;
1469
1527
  return null;
1470
1528
  }
@@ -1480,9 +1538,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1480
1538
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1481
1539
  ExecuteQuery = async () => {
1482
1540
  try {
1541
+ const __snapshot1 = performance.now();
1483
1542
  const client = await this.GetClient();
1543
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1484
1544
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1485
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1545
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1546
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1547
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1548
+ return retVal.body;
1486
1549
  } catch (error) {
1487
1550
  this.runner.instrumentData.errorCount++;
1488
1551
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);