@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.
@@ -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();
@@ -576,8 +585,12 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
576
585
  else if (diff <= 10) this.runner.instrumentData.duration10++;
577
586
  else if (diff <= 20) this.runner.instrumentData.duration20++;
578
587
  else if (diff <= 30) this.runner.instrumentData.duration30++;
588
+ else if (diff <= 40) this.runner.instrumentData.duration40++;
579
589
  else if (diff <= 50) this.runner.instrumentData.duration50++;
590
+ else if (diff <= 60) this.runner.instrumentData.duration60++;
591
+ else if (diff <= 80) this.runner.instrumentData.duration80++;
580
592
  else if (diff <= 100) this.runner.instrumentData.duration100++;
593
+ else if (diff <= 120) this.runner.instrumentData.duration120++;
581
594
  else if (diff <= 150) this.runner.instrumentData.duration150++;
582
595
  else if (diff <= 250) this.runner.instrumentData.duration250++;
583
596
  else if (diff <= 500) this.runner.instrumentData.duration500++;
@@ -606,7 +619,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
606
619
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
607
620
  ExecuteQuery = async () => {
608
621
  try {
622
+ const __snapshot1 = performance.now();
609
623
  await this.GetAccessToken();
624
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
610
625
  this.accesssToken = null;
611
626
  return null;
612
627
  } catch (error) {
@@ -621,10 +636,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
621
636
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
622
637
  ExecuteQuery = async () => {
623
638
  try {
639
+ const __snapshot1 = performance.now();
624
640
  const client = await this.GetClient();
641
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
625
642
  const prefix = this.runner.options.personPrefix;
626
643
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
627
- return (await client.PostResource("Person", personRecord)).body;
644
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
645
+ const retVal = await client.PostResource("Person", personRecord);
646
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
647
+ return retVal.body;
628
648
  } catch (error) {
629
649
  this.runner.instrumentData.errorCount++;
630
650
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -637,9 +657,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
637
657
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
638
658
  ExecuteQuery = async () => {
639
659
  try {
660
+ const __snapshot1 = performance.now();
640
661
  const client = await this.GetClient();
662
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
641
663
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
664
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
642
665
  const retVal = await client.GetResource("Person", personRecord.id);
666
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
643
667
  delete personRecord.meta;
644
668
  delete retVal.body.meta;
645
669
  const p1 = JSON.stringify(personRecord);
@@ -658,9 +682,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
658
682
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
659
683
  ExecuteQuery = async () => {
660
684
  try {
685
+ const __snapshot1 = performance.now();
661
686
  const client = await this.GetClient();
687
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
662
688
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
689
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
663
690
  const retVal = await client.GetResource("Person", personRecord.id);
691
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
664
692
  this.runner.instrumentData.requestCount++;
665
693
  const compPersonRecord = { ...personRecord };
666
694
  const loadedPersonRecorded = { ...retVal.body };
@@ -676,6 +704,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
676
704
  if (originalPersonRecord && originalPersonRecord.text) {
677
705
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
678
706
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
707
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
679
708
  const updatedRecord = { ...retVal.body };
680
709
  delete updatedRecord.meta;
681
710
  delete originalPersonRecord.meta;
@@ -699,11 +728,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
699
728
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
700
729
  ExecuteQuery = async () => {
701
730
  try {
731
+ const __snapshot1 = performance.now();
702
732
  const client = await this.GetClient();
733
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
703
734
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
735
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
704
736
  if (originalPersonRecord && originalPersonRecord.text) {
705
737
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
706
738
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
739
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
707
740
  const updatedRecord = { ...retVal.body };
708
741
  delete updatedRecord.meta;
709
742
  delete originalPersonRecord.meta;
@@ -727,11 +760,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
727
760
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
728
761
  ExecuteQuery = async () => {
729
762
  try {
763
+ const __snapshot1 = performance.now();
730
764
  const client = await this.GetClient();
765
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
731
766
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
732
767
  const prefix = this.runner.options.personPrefix;
733
768
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
734
- performance.now();
769
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
735
770
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
736
771
  let retVal;
737
772
  if (this.runner.options.useDirectQuery === true) {
@@ -740,8 +775,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
740
775
  family: personRecord.name[0].family
741
776
  };
742
777
  retVal = await client.GenericSearchTesting("Person", data);
743
- } else retVal = await client.GetResources(url);
744
- performance.now();
778
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
779
+ } else {
780
+ retVal = await client.GetResources(url);
781
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
782
+ }
745
783
  return retVal.body;
746
784
  } catch (error) {
747
785
  this.runner.instrumentData.errorCount++;
@@ -1402,13 +1440,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1402
1440
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1403
1441
  ExecuteQuery = async () => {
1404
1442
  try {
1443
+ const __snapshot1 = performance.now();
1405
1444
  const client = await this.GetClient();
1445
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1406
1446
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1407
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1447
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1448
+ const retVal = await client.GetResource("Person", personRecord.id);
1449
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1450
+ const resource = retVal.body;
1408
1451
  const observer = fast_json_patch_default.observe(resource);
1409
1452
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1410
1453
  const patchRecord = fast_json_patch_default.generate(observer);
1411
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1454
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1455
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1456
+ return retValPatched.body;
1412
1457
  } catch (error) {
1413
1458
  this.runner.instrumentData.errorCount++;
1414
1459
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1421,11 +1466,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1421
1466
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1422
1467
  ExecuteQuery = async () => {
1423
1468
  try {
1469
+ const __snapshot1 = performance.now();
1424
1470
  const client = await this.GetClient();
1471
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1425
1472
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1426
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1473
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1474
+ const retVal = await client.GetResource("Person", personRecord.id);
1475
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1476
+ const resource = retVal.body;
1427
1477
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1428
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1478
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1479
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1480
+ return retValPatched.body;
1429
1481
  } catch (error) {
1430
1482
  this.runner.instrumentData.errorCount++;
1431
1483
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1438,10 +1490,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1438
1490
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1439
1491
  ExecuteQuery = async () => {
1440
1492
  try {
1493
+ const __snapshot1 = performance.now();
1441
1494
  const client = await this.GetClient();
1495
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1442
1496
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1443
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1444
- else {
1497
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1498
+ if (personRecord.text) {
1499
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1500
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1501
+ return retVal.body;
1502
+ } else {
1445
1503
  this.runner.instrumentData.errorCount++;
1446
1504
  return null;
1447
1505
  }
@@ -1457,9 +1515,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1457
1515
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1458
1516
  ExecuteQuery = async () => {
1459
1517
  try {
1518
+ const __snapshot1 = performance.now();
1460
1519
  const client = await this.GetClient();
1520
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1461
1521
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1462
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1522
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1523
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1524
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1525
+ return retVal.body;
1463
1526
  } catch (error) {
1464
1527
  this.runner.instrumentData.errorCount++;
1465
1528
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);