@opentap/runner-client 2.25.2-alpha.1.2.11280720052 → 2.25.2

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.
@@ -307,11 +307,11 @@ var RunnerClient = /** @class */ (function (_super) {
307
307
  switch (_b.label) {
308
308
  case 0:
309
309
  _loop_1 = function () {
310
- var consumerInfo, arraySize, metricData_1, messages, index, messages_1, messages_1_1, message, e_1_1, error_1, error_2;
310
+ var consumerInfo, arraySize, metricData_1, messages, index, messages_1, messages_1_1, message, e_1_1, error_1;
311
311
  return __generator(this, function (_c) {
312
312
  switch (_c.label) {
313
313
  case 0:
314
- _c.trys.push([0, 18, , 19]);
314
+ _c.trys.push([0, 15, , 16]);
315
315
  return [4 /*yield*/, consumer.info()];
316
316
  case 1:
317
317
  consumerInfo = _c.sent();
@@ -320,21 +320,18 @@ var RunnerClient = /** @class */ (function (_super) {
320
320
  encodedMetrics: new Array(arraySize),
321
321
  timestamps: new Array(arraySize),
322
322
  };
323
- _c.label = 2;
324
- case 2:
325
- _c.trys.push([2, 16, , 17]);
326
323
  return [4 /*yield*/, consumer.fetch({ max_messages: arraySize })];
327
- case 3:
324
+ case 2:
328
325
  messages = _c.sent();
329
326
  index = 0;
330
- _c.label = 4;
331
- case 4:
332
- _c.trys.push([4, 9, 10, 15]);
327
+ _c.label = 3;
328
+ case 3:
329
+ _c.trys.push([3, 8, 9, 14]);
333
330
  messages_1 = (e_1 = void 0, __asyncValues(messages));
334
- _c.label = 5;
335
- case 5: return [4 /*yield*/, messages_1.next()];
336
- case 6:
337
- if (!(messages_1_1 = _c.sent(), !messages_1_1.done)) return [3 /*break*/, 8];
331
+ _c.label = 4;
332
+ case 4: return [4 /*yield*/, messages_1.next()];
333
+ case 5:
334
+ if (!(messages_1_1 = _c.sent(), !messages_1_1.done)) return [3 /*break*/, 7];
338
335
  message = messages_1_1.value;
339
336
  // Store the message data and timestamp
340
337
  metricData_1.encodedMetrics[index] = message.data;
@@ -344,38 +341,34 @@ var RunnerClient = /** @class */ (function (_super) {
344
341
  (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
345
342
  return [2 /*return*/, handler(metricData_1)];
346
343
  }); }); })();
347
- return [3 /*break*/, 8];
344
+ return [3 /*break*/, 7];
348
345
  }
349
346
  // Increment the index
350
347
  index++;
351
- _c.label = 7;
352
- case 7: return [3 /*break*/, 5];
353
- case 8: return [3 /*break*/, 15];
354
- case 9:
348
+ _c.label = 6;
349
+ case 6: return [3 /*break*/, 4];
350
+ case 7: return [3 /*break*/, 14];
351
+ case 8:
355
352
  e_1_1 = _c.sent();
356
353
  e_1 = { error: e_1_1 };
357
- return [3 /*break*/, 15];
358
- case 10:
359
- _c.trys.push([10, , 13, 14]);
360
- if (!(messages_1_1 && !messages_1_1.done && (_a = messages_1.return))) return [3 /*break*/, 12];
354
+ return [3 /*break*/, 14];
355
+ case 9:
356
+ _c.trys.push([9, , 12, 13]);
357
+ if (!(messages_1_1 && !messages_1_1.done && (_a = messages_1.return))) return [3 /*break*/, 11];
361
358
  return [4 /*yield*/, _a.call(messages_1)];
362
- case 11:
359
+ case 10:
363
360
  _c.sent();
364
- _c.label = 12;
365
- case 12: return [3 /*break*/, 14];
366
- case 13:
361
+ _c.label = 11;
362
+ case 11: return [3 /*break*/, 13];
363
+ case 12:
367
364
  if (e_1) throw e_1.error;
368
365
  return [7 /*endfinally*/];
369
- case 14: return [7 /*endfinally*/];
370
- case 15: return [3 /*break*/, 17];
371
- case 16:
366
+ case 13: return [7 /*endfinally*/];
367
+ case 14: return [3 /*break*/, 16];
368
+ case 15:
372
369
  error_1 = _c.sent();
373
370
  return [2 /*return*/, "break"];
374
- case 17: return [3 /*break*/, 19];
375
- case 18:
376
- error_2 = _c.sent();
377
- return [2 /*return*/, "break"];
378
- case 19: return [2 /*return*/];
371
+ case 16: return [2 /*return*/];
379
372
  }
380
373
  });
381
374
  };
@@ -252,36 +252,31 @@ export class RunnerClient extends BaseClient {
252
252
  encodedMetrics: new Array(arraySize),
253
253
  timestamps: new Array(arraySize),
254
254
  };
255
+ // Fetch the messages
256
+ const messages = yield consumer.fetch({ max_messages: arraySize });
257
+ // for await of doesn't return the index, so we need to keep track of it
258
+ let index = 0;
255
259
  try {
256
- // Fetch the messages
257
- const messages = yield consumer.fetch({ max_messages: arraySize });
258
- // for await of doesn't return the index, so we need to keep track of it
259
- let index = 0;
260
- try {
261
- for (var messages_1 = (e_1 = void 0, __asyncValues(messages)), messages_1_1; messages_1_1 = yield messages_1.next(), !messages_1_1.done;) {
262
- const message = messages_1_1.value;
263
- // Store the message data and timestamp
264
- metricData.encodedMetrics[index] = message.data;
265
- metricData.timestamps[index] = message.info.timestampNanos;
266
- // If we are at the last message or there are no more pending messages, call the handler
267
- if (index === arraySize - 1 || message.info.pending === 0) {
268
- (() => __awaiter(this, void 0, void 0, function* () { return handler(metricData); }))();
269
- break;
270
- }
271
- // Increment the index
272
- index++;
273
- }
274
- }
275
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
276
- finally {
277
- try {
278
- if (messages_1_1 && !messages_1_1.done && (_a = messages_1.return)) yield _a.call(messages_1);
260
+ for (var messages_1 = (e_1 = void 0, __asyncValues(messages)), messages_1_1; messages_1_1 = yield messages_1.next(), !messages_1_1.done;) {
261
+ const message = messages_1_1.value;
262
+ // Store the message data and timestamp
263
+ metricData.encodedMetrics[index] = message.data;
264
+ metricData.timestamps[index] = message.info.timestampNanos;
265
+ // If we are at the last message or there are no more pending messages, call the handler
266
+ if (index === arraySize - 1 || message.info.pending === 0) {
267
+ (() => __awaiter(this, void 0, void 0, function* () { return handler(metricData); }))();
268
+ break;
279
269
  }
280
- finally { if (e_1) throw e_1.error; }
270
+ // Increment the index
271
+ index++;
281
272
  }
282
273
  }
283
- catch (error) {
284
- break;
274
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
275
+ finally {
276
+ try {
277
+ if (messages_1_1 && !messages_1_1.done && (_a = messages_1.return)) yield _a.call(messages_1);
278
+ }
279
+ finally { if (e_1) throw e_1.error; }
285
280
  }
286
281
  }
287
282
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.25.2-alpha.1.2.11280720052",
3
+ "version": "2.25.2",
4
4
  "description": "This is the web client for the OpenTAP Runner.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/mjs/index.js",