@nsshunt/ststestrunner 1.1.70 → 1.1.71

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.
@@ -154,41 +154,32 @@ var TestCaseFhirBase = class {
154
154
  GetFhirSocketClient = async () => {
155
155
  try {
156
156
  this.#clientSocketFetchCount++;
157
- const optionszz = this.runnerExecutionWorker.Options;
158
- if (optionszz) {
159
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
160
- console.log(`optionszz`);
161
- console.log(optionszz);
162
- console.log(this.runnerExecutionWorker.id);
163
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
164
- } else {
165
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
166
- console.log(`no optionszz`);
167
- console.log(this.runnerExecutionWorker.id);
168
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
169
- }
170
157
  let fhirClient = this.runnerExecutionWorker.GetFhirClient();
171
158
  if (fhirClient) {
172
- console.log(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client`));
159
+ this.Debug(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client`));
173
160
  return fhirClient;
174
161
  }
175
162
  if (this.runnerExecutionWorker.GetOnHold("fhirclient") === true) {
176
- console.log(chalk.default.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client - waiting ...`));
163
+ this.Debug(chalk.default.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client (on hold/lock) - waiting ...`));
177
164
  try {
165
+ const start = performance.now();
178
166
  await this.runnerExecutionWorker.WaitOnHold("fhirclient", 6e4);
167
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] hold (lock) released after: [${performance.now() - start}ms]`));
179
168
  const fhirClient = this.runnerExecutionWorker.GetFhirClient();
180
169
  if (fhirClient) {
181
- console.log(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
170
+ this.Debug(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
182
171
  return fhirClient;
183
172
  } else {
184
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
185
- console.log(chalk.default.red(`continue anyway ...`));
173
+ this.Error(chalk.default.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
174
+ this.Error(chalk.default.red(`continue anyway ...`));
186
175
  }
187
176
  } catch (error) {
188
- console.error(chalk.default.red(`GetFhirSocketClient(): Error: [${error}]`));
177
+ this.Error(chalk.default.red(`GetFhirSocketClient(): Error: [${error}]`));
189
178
  }
190
179
  }
191
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
180
+ const start = performance.now();
181
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
182
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] setting hold (lock)`));
192
183
  this.runnerExecutionWorker.SetOnHold("fhirclient");
193
184
  const fhirOptions = this.#options.fhirOptions;
194
185
  const options = {
@@ -209,9 +200,10 @@ var TestCaseFhirBase = class {
209
200
  if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientAllInOne("FhirSocketClient", options);
210
201
  else fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientIndividual("FhirSocketClient", options);
211
202
  await fhirClient.WaitForSocketConnected();
212
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
203
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
213
204
  this.runnerExecutionWorker.SetFhirClient(fhirClient);
214
205
  this.runnerExecutionWorker.ReleaseOnHold("fhirclient");
206
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] release hold (lock) Time taken for socket connection and set object: [${performance.now() - start}ms]`));
215
207
  return fhirClient;
216
208
  } catch (error) {
217
209
  this.LogErrorMessage(error);