@nsshunt/stsobservability 1.0.30 → 1.0.32
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.
- package/dist/stsobservability.mjs +207 -338
- package/dist/stsobservability.mjs.map +1 -1
- package/dist/stsobservability.umd.js +207 -338
- package/dist/stsobservability.umd.js.map +1 -1
- package/package.json +9 -9
- package/types/globalServiceDefinitions.d.ts.map +1 -1
- package/types/publish/publishers/publishTransportRESTServer.d.ts.map +1 -1
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
var __accessCheck = (obj, member, msg) => {
|
|
8
|
-
if (!member.has(obj))
|
|
9
|
-
throw TypeError("Cannot " + msg);
|
|
10
|
-
};
|
|
11
|
-
var __privateGet = (obj, member, getter) => {
|
|
12
|
-
__accessCheck(obj, member, "read from private field");
|
|
13
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
14
|
-
};
|
|
15
|
-
var __privateAdd = (obj, member, value) => {
|
|
16
|
-
if (member.has(obj))
|
|
17
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
18
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
19
|
-
};
|
|
20
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
21
|
-
__accessCheck(obj, member, "write to private field");
|
|
22
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
23
|
-
return value;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
24
4
|
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
25
12
|
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
26
13
|
set _(value) {
|
|
27
14
|
__privateSet(obj, member, value, setter);
|
|
@@ -30,11 +17,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
30
17
|
return __privateGet(obj, member, getter);
|
|
31
18
|
}
|
|
32
19
|
});
|
|
33
|
-
var
|
|
34
|
-
__accessCheck(obj, member, "access private method");
|
|
35
|
-
return method;
|
|
36
|
-
};
|
|
37
|
-
var _label, _options, _data, _a, _interval, _timeoutComputeVelocity, _lastVelocity, _delta, _maxVelocity, _timerInterval, _copy, _velocity, _velocityVal, _valStack, _averageValStack, _maxAverageValStack, _maxAverageIterations, _valStackMaxLength, _valStackAverage, _timeStamp, _maxTimeDiff, _vaTimeDiff, _velocityTimeDiff, _autoComputeVelocity, _autoComputeVelocityTimeout, _countDiff, _timeDiff, _deltaCountDiff, _deltaTimeDif, _minTimeForReporting, _averageVelocity, _ComputeVelocityByTimeDiff, ComputeVelocityByTimeDiff_fn, _ComputeVelocity, ComputeVelocity_fn, _SetupAutoComputeVelocity, SetupAutoComputeVelocity_fn, _GetVelocityStackAverage, GetVelocityStackAverage_fn, _GetVal, GetVal_fn, _SetVal, SetVal_fn, _GetVelocity, GetVelocity_fn, _GetMaxVelocity, GetMaxVelocity_fn, _GetDelta, GetDelta_fn, _GetTimeStamp, GetTimeStamp_fn, _GetCountDiff, GetCountDiff_fn, _GetTimeDiff, GetTimeDiff_fn, _GetDeltaCountDiff, GetDeltaCountDiff_fn, _GetDeltaTimeDif, GetDeltaTimeDif_fn, _GetAverageVelocity, GetAverageVelocity_fn, _histogramData, _val, _copy2, _GetVal2, GetVal_fn2, _SetVal2, SetVal_fn2, _GetHistogramData, GetHistogramData_fn, _SetHistogramData, SetHistogramData_fn, _messages, _readPos, _maxSize, _copy3, _useLatestMessages, _consoleLogging, _instrumentLogging, _winstonLogging, _stsLogger, _DumpToConsole, DumpToConsole_fn, _GetVal3, GetVal_fn3, _SetVal3, SetVal_fn3, _start, _copy4, _pauseVal, _GetVal4, GetVal_fn4, _SetVal4, SetVal_fn4, _convertMS, convertMS_fn, _val2, _maxval, _lastObservedValue, _timeSeriesList, _maxSampleSize, _timerInterval2, _observer, _min, _max, _observations, _total, _copy5, _GetVal5, GetVal_fn5, _SetVal5, SetVal_fn5, _GetMin, GetMin_fn, _GetMax, GetMax_fn, _GetAverage, GetAverage_fn, _GetAndResetMaxVal, GetAndResetMaxVal_fn, _NumberCompare, NumberCompare_fn, _GetPercentileData, GetPercentileData_fn, _val3, _copy6, _GetVal6, GetVal_fn6, _SetVal6, SetVal_fn6, _tinyEmitter, _RequestCompleted, _instruments, _inPublish, _observer2, _publishState, _GetInstrument, GetInstrument_fn, _ProcessTelemetryCommand, ProcessTelemetryCommand_fn, _CreateInstrument, CreateInstrument_fn, _CreateInstruments, CreateInstruments_fn, _GetPayloadData, GetPayloadData_fn, _PublishTimeoutLoop, PublishTimeoutLoop_fn, _UpdateState, UpdateState_fn, _httpsAgent, _kafkaLog, _maxLogLength, _socketSubscribeKeepAlive, _options2, _LogDebugMessage, LogDebugMessage_fn, _LogErrorMessage, LogErrorMessage_fn, _InvokeRESTAPI, InvokeRESTAPI_fn, _GetData, _SetupTimeout, SetupTimeout_fn, _AddKeepAlive, AddKeepAlive_fn, _RemoveKeepAlive, RemoveKeepAlive_fn, _messageWithAckPayloadRecords, _socket, _maxReties, _timeoutValue, _options3, _LogDebugMessage2, LogDebugMessage_fn2, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn, _socketSubscribeKeepAlive2, _socket2, _options4, _socketIoMessageSender, _LogDebugMessage3, LogDebugMessage_fn3, _LogErrorMessage2, LogErrorMessage_fn2, _AddKeepAlive2, AddKeepAlive_fn2, _RemoveKeepAlive2, RemoveKeepAlive_fn2, _observabilitySocketIOSubscriber, _subscriptions, _kafkaHelper, _serviceModel, _agentModel, _lambdaModel, _options5, _LogDebugMessage4, LogDebugMessage_fn4, _LogErrorMessage3, LogErrorMessage_fn3, _options6, _sockets, _httpsAgent2, _LogDebugMessage5, LogDebugMessage_fn5, _LogErrorMessage4, LogErrorMessage_fn4, _EstablishSocketConnect, EstablishSocketConnect_fn;
|
|
20
|
+
var _a, _label, _options, _data, _interval, _timeoutComputeVelocity, _lastVelocity, _delta, _maxVelocity, _timerInterval, _copy, _velocity, _velocityVal, _valStack, _averageValStack, _maxAverageValStack, _maxAverageIterations, _valStackMaxLength, _valStackAverage, _timeStamp, _maxTimeDiff, _vaTimeDiff, _velocityTimeDiff, _autoComputeVelocity, _autoComputeVelocityTimeout, _countDiff, _timeDiff, _deltaCountDiff, _deltaTimeDif, _minTimeForReporting, _averageVelocity, _InstrumentVelocity_instances, ComputeVelocityByTimeDiff_fn, ComputeVelocity_fn, SetupAutoComputeVelocity_fn, GetVelocityStackAverage_fn, GetVal_fn, SetVal_fn, GetVelocity_fn, GetMaxVelocity_fn, GetDelta_fn, GetTimeStamp_fn, GetCountDiff_fn, GetTimeDiff_fn, GetDeltaCountDiff_fn, GetDeltaTimeDif_fn, GetAverageVelocity_fn, _histogramData, _val, _copy2, _InstrumentHistogram_instances, GetVal_fn2, SetVal_fn2, GetHistogramData_fn, SetHistogramData_fn, _messages, _readPos, _maxSize, _copy3, _useLatestMessages, _consoleLogging, _instrumentLogging, _winstonLogging, _stsLogger, _InstrumentLog_instances, DumpToConsole_fn, GetVal_fn3, SetVal_fn3, _start, _copy4, _pauseVal, _InstrumentTimerGauge_instances, GetVal_fn4, SetVal_fn4, convertMS_fn, _val2, _maxval, _lastObservedValue, _timeSeriesList, _maxSampleSize, _timerInterval2, _observer, _min, _max, _observations, _total, _copy5, _InstrumentGauge_instances, GetVal_fn5, SetVal_fn5, GetMin_fn, GetMax_fn, GetAverage_fn, GetAndResetMaxVal_fn, NumberCompare_fn, GetPercentileData_fn, _val3, _copy6, _InstrumentObject_instances, GetVal_fn6, SetVal_fn6, _tinyEmitter, _RequestCompleted, _instruments, _inPublish, _observer2, _publishState, _PublishInstrumentController_instances, GetInstrument_fn, ProcessTelemetryCommand_fn, CreateInstrument_fn, CreateInstruments_fn, GetPayloadData_fn, PublishTimeoutLoop_fn, UpdateState_fn, _httpsAgent, _kafkaLog, _maxLogLength, _socketSubscribeKeepAlive, _options2, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn, LogErrorMessage_fn, InvokeRESTAPI_fn, _GetData, SetupTimeout_fn, AddKeepAlive_fn, RemoveKeepAlive_fn, _messageWithAckPayloadRecords, _socket, _maxReties, _timeoutValue, _options3, _SocketIoMessageSender_instances, LogDebugMessage_fn2, GetSubscribeKeepAliveAckEventName_fn, _socketSubscribeKeepAlive2, _socket2, _options4, _socketIoMessageSender, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3, LogErrorMessage_fn2, AddKeepAlive_fn2, RemoveKeepAlive_fn2, _observabilitySocketIOSubscriber, _subscriptions, _kafkaHelper, _serviceModel, _agentModel, _lambdaModel, _options5, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4, LogErrorMessage_fn3, _options6, _sockets, _httpsAgent2, _SocketIoClientHelper_instances, LogDebugMessage_fn5, LogErrorMessage_fn4, EstablishSocketConnect_fn;
|
|
38
21
|
import _cloneDeep from "lodash.clonedeep";
|
|
39
22
|
import isNode from "detect-node";
|
|
40
23
|
import { STSOptionsBase } from "@nsshunt/stsutils";
|
|
@@ -93,6 +76,7 @@ class InstrumentBaseOptions {
|
|
|
93
76
|
}
|
|
94
77
|
class InstrumentBaseTelemetry {
|
|
95
78
|
}
|
|
79
|
+
_a = GaugeTypes.GAUGE_TYPE;
|
|
96
80
|
class InstrumentBase {
|
|
97
81
|
// Use for copy objects only.
|
|
98
82
|
//protected _data: Record<string, any> = { };
|
|
@@ -181,7 +165,6 @@ class InstrumentBase {
|
|
|
181
165
|
}
|
|
182
166
|
*/
|
|
183
167
|
}
|
|
184
|
-
_a = GaugeTypes.GAUGE_TYPE;
|
|
185
168
|
_label = new WeakMap();
|
|
186
169
|
_options = new WeakMap();
|
|
187
170
|
_data = new WeakMap();
|
|
@@ -212,21 +195,7 @@ class InstrumentVelocity extends InstrumentBase {
|
|
|
212
195
|
// window may be "spikey" depending on the volatility of the data being recorded.
|
|
213
196
|
constructor(options = {}) {
|
|
214
197
|
super(options);
|
|
215
|
-
__privateAdd(this,
|
|
216
|
-
__privateAdd(this, _ComputeVelocity);
|
|
217
|
-
__privateAdd(this, _SetupAutoComputeVelocity);
|
|
218
|
-
__privateAdd(this, _GetVelocityStackAverage);
|
|
219
|
-
__privateAdd(this, _GetVal);
|
|
220
|
-
__privateAdd(this, _SetVal);
|
|
221
|
-
__privateAdd(this, _GetVelocity);
|
|
222
|
-
__privateAdd(this, _GetMaxVelocity);
|
|
223
|
-
__privateAdd(this, _GetDelta);
|
|
224
|
-
__privateAdd(this, _GetTimeStamp);
|
|
225
|
-
__privateAdd(this, _GetCountDiff);
|
|
226
|
-
__privateAdd(this, _GetTimeDiff);
|
|
227
|
-
__privateAdd(this, _GetDeltaCountDiff);
|
|
228
|
-
__privateAdd(this, _GetDeltaTimeDif);
|
|
229
|
-
__privateAdd(this, _GetAverageVelocity);
|
|
198
|
+
__privateAdd(this, _InstrumentVelocity_instances);
|
|
230
199
|
//#val = 0;
|
|
231
200
|
__privateAdd(this, _interval, null);
|
|
232
201
|
__privateAdd(this, _timeoutComputeVelocity, null);
|
|
@@ -340,50 +309,50 @@ class InstrumentVelocity extends InstrumentBase {
|
|
|
340
309
|
} else {
|
|
341
310
|
Object.defineProperty(this, "val", {
|
|
342
311
|
enumerable: true,
|
|
343
|
-
get: () => __privateMethod(this,
|
|
312
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetVal_fn).call(this),
|
|
344
313
|
set: (value) => {
|
|
345
|
-
__privateMethod(this,
|
|
314
|
+
__privateMethod(this, _InstrumentVelocity_instances, SetVal_fn).call(this, value);
|
|
346
315
|
}
|
|
347
316
|
});
|
|
348
317
|
Object.defineProperty(this, "maxVelocity", {
|
|
349
318
|
enumerable: true,
|
|
350
|
-
get: () => __privateMethod(this,
|
|
319
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetMaxVelocity_fn).call(this)
|
|
351
320
|
});
|
|
352
321
|
Object.defineProperty(this, "delta", {
|
|
353
322
|
enumerable: true,
|
|
354
|
-
get: () => __privateMethod(this,
|
|
323
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetDelta_fn).call(this)
|
|
355
324
|
});
|
|
356
325
|
Object.defineProperty(this, "velocity", {
|
|
357
326
|
enumerable: true,
|
|
358
|
-
get: () => __privateMethod(this,
|
|
327
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetVelocity_fn).call(this)
|
|
359
328
|
});
|
|
360
329
|
Object.defineProperty(this, "va", {
|
|
361
330
|
enumerable: true,
|
|
362
|
-
get: () => __privateMethod(this,
|
|
331
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetVelocityStackAverage_fn).call(this)
|
|
363
332
|
});
|
|
364
333
|
Object.defineProperty(this, "timeStamp", {
|
|
365
334
|
enumerable: true,
|
|
366
|
-
get: () => __privateMethod(this,
|
|
335
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetTimeStamp_fn).call(this)
|
|
367
336
|
});
|
|
368
337
|
Object.defineProperty(this, "countDiff", {
|
|
369
338
|
enumerable: true,
|
|
370
|
-
get: () => __privateMethod(this,
|
|
339
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetCountDiff_fn).call(this)
|
|
371
340
|
});
|
|
372
341
|
Object.defineProperty(this, "timeDiff", {
|
|
373
342
|
enumerable: true,
|
|
374
|
-
get: () => __privateMethod(this,
|
|
343
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetTimeDiff_fn).call(this)
|
|
375
344
|
});
|
|
376
345
|
Object.defineProperty(this, "deltaCountDiff", {
|
|
377
346
|
enumerable: true,
|
|
378
|
-
get: () => __privateMethod(this,
|
|
347
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetDeltaCountDiff_fn).call(this)
|
|
379
348
|
});
|
|
380
349
|
Object.defineProperty(this, "deltaTimeDif", {
|
|
381
350
|
enumerable: true,
|
|
382
|
-
get: () => __privateMethod(this,
|
|
351
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetDeltaTimeDif_fn).call(this)
|
|
383
352
|
});
|
|
384
353
|
Object.defineProperty(this, "averageVelocity", {
|
|
385
354
|
enumerable: true,
|
|
386
|
-
get: () => __privateMethod(this,
|
|
355
|
+
get: () => __privateMethod(this, _InstrumentVelocity_instances, GetAverageVelocity_fn).call(this)
|
|
387
356
|
});
|
|
388
357
|
if (__privateGet(this, _timerInterval) > 0 && __privateGet(this, _autoComputeVelocity) === false) {
|
|
389
358
|
this._StartTimer();
|
|
@@ -414,7 +383,7 @@ class InstrumentVelocity extends InstrumentBase {
|
|
|
414
383
|
}
|
|
415
384
|
_StartTimer() {
|
|
416
385
|
__privateSet(this, _interval, setInterval(() => {
|
|
417
|
-
__privateMethod(this,
|
|
386
|
+
__privateMethod(this, _InstrumentVelocity_instances, ComputeVelocity_fn).call(this);
|
|
418
387
|
let pushVal = __privateGet(this, _velocity);
|
|
419
388
|
for (let i = 0; i < __privateGet(this, _maxAverageIterations); i++) {
|
|
420
389
|
if (!__privateGet(this, _averageValStack)[i]) {
|
|
@@ -435,9 +404,9 @@ class InstrumentVelocity extends InstrumentBase {
|
|
|
435
404
|
Inc(incVal = 1) {
|
|
436
405
|
__privateSet(this, _velocityVal, __privateGet(this, _velocityVal) + incVal);
|
|
437
406
|
if (__privateGet(this, _autoComputeVelocity)) {
|
|
438
|
-
__privateMethod(this,
|
|
407
|
+
__privateMethod(this, _InstrumentVelocity_instances, ComputeVelocity_fn).call(this);
|
|
439
408
|
} else {
|
|
440
|
-
__privateMethod(this,
|
|
409
|
+
__privateMethod(this, _InstrumentVelocity_instances, SetupAutoComputeVelocity_fn).call(this);
|
|
441
410
|
}
|
|
442
411
|
}
|
|
443
412
|
StopTimer() {
|
|
@@ -482,7 +451,7 @@ _deltaCountDiff = new WeakMap();
|
|
|
482
451
|
_deltaTimeDif = new WeakMap();
|
|
483
452
|
_minTimeForReporting = new WeakMap();
|
|
484
453
|
_averageVelocity = new WeakMap();
|
|
485
|
-
|
|
454
|
+
_InstrumentVelocity_instances = new WeakSet();
|
|
486
455
|
ComputeVelocityByTimeDiff_fn = function(checkTimeDiff, checkDeltaTimeDiff) {
|
|
487
456
|
let val = 0;
|
|
488
457
|
let deltaVal = 0;
|
|
@@ -548,7 +517,6 @@ ComputeVelocityByTimeDiff_fn = function(checkTimeDiff, checkDeltaTimeDiff) {
|
|
|
548
517
|
deltaTimeDiff
|
|
549
518
|
};
|
|
550
519
|
};
|
|
551
|
-
_ComputeVelocity = new WeakSet();
|
|
552
520
|
ComputeVelocity_fn = function() {
|
|
553
521
|
const dp = {
|
|
554
522
|
timeStamp: performance.now(),
|
|
@@ -559,9 +527,9 @@ ComputeVelocity_fn = function() {
|
|
|
559
527
|
while (__privateGet(this, _valStack).length > 0 && __privateGet(this, _timeStamp) - __privateGet(this, _valStack)[0].timeStamp > __privateGet(this, _maxTimeDiff)) {
|
|
560
528
|
__privateGet(this, _valStack).shift();
|
|
561
529
|
}
|
|
562
|
-
const valStackAverageDataPoint = __privateMethod(this,
|
|
530
|
+
const valStackAverageDataPoint = __privateMethod(this, _InstrumentVelocity_instances, ComputeVelocityByTimeDiff_fn).call(this, __privateGet(this, _vaTimeDiff), 0);
|
|
563
531
|
__privateSet(this, _valStackAverage, valStackAverageDataPoint.val);
|
|
564
|
-
const velocityDataPoint = __privateMethod(this,
|
|
532
|
+
const velocityDataPoint = __privateMethod(this, _InstrumentVelocity_instances, ComputeVelocityByTimeDiff_fn).call(this, __privateGet(this, _velocityTimeDiff), __privateGet(this, _velocityTimeDiff) * 2);
|
|
565
533
|
__privateSet(this, _velocity, velocityDataPoint.val);
|
|
566
534
|
__privateSet(this, _delta, velocityDataPoint.val - velocityDataPoint.deltaVal);
|
|
567
535
|
__privateSet(this, _countDiff, velocityDataPoint.countDiff);
|
|
@@ -573,65 +541,52 @@ ComputeVelocity_fn = function() {
|
|
|
573
541
|
__privateSet(this, _maxVelocity, __privateGet(this, _velocity));
|
|
574
542
|
}
|
|
575
543
|
};
|
|
576
|
-
_SetupAutoComputeVelocity = new WeakSet();
|
|
577
544
|
SetupAutoComputeVelocity_fn = function() {
|
|
578
545
|
if (__privateGet(this, _timeoutComputeVelocity)) {
|
|
579
546
|
clearTimeout(__privateGet(this, _timeoutComputeVelocity));
|
|
580
547
|
}
|
|
581
548
|
__privateSet(this, _timeoutComputeVelocity, setTimeout(() => {
|
|
582
|
-
__privateMethod(this,
|
|
549
|
+
__privateMethod(this, _InstrumentVelocity_instances, ComputeVelocity_fn).call(this);
|
|
583
550
|
}, __privateGet(this, _autoComputeVelocityTimeout)));
|
|
584
551
|
};
|
|
585
|
-
_GetVelocityStackAverage = new WeakSet();
|
|
586
552
|
GetVelocityStackAverage_fn = function() {
|
|
587
553
|
return this.GetNumber(__privateGet(this, _valStackAverage));
|
|
588
554
|
};
|
|
589
|
-
_GetVal = new WeakSet();
|
|
590
555
|
GetVal_fn = function() {
|
|
591
556
|
return this.GetNumber(__privateGet(this, _velocityVal));
|
|
592
557
|
};
|
|
593
|
-
_SetVal = new WeakSet();
|
|
594
558
|
SetVal_fn = function(updatedValue) {
|
|
595
559
|
__privateSet(this, _velocityVal, updatedValue);
|
|
596
560
|
if (__privateGet(this, _autoComputeVelocity)) {
|
|
597
|
-
__privateMethod(this,
|
|
561
|
+
__privateMethod(this, _InstrumentVelocity_instances, ComputeVelocity_fn).call(this);
|
|
598
562
|
} else {
|
|
599
|
-
__privateMethod(this,
|
|
563
|
+
__privateMethod(this, _InstrumentVelocity_instances, SetupAutoComputeVelocity_fn).call(this);
|
|
600
564
|
}
|
|
601
565
|
};
|
|
602
|
-
_GetVelocity = new WeakSet();
|
|
603
566
|
GetVelocity_fn = function() {
|
|
604
567
|
return this.GetNumber(__privateGet(this, _velocity));
|
|
605
568
|
};
|
|
606
|
-
_GetMaxVelocity = new WeakSet();
|
|
607
569
|
GetMaxVelocity_fn = function() {
|
|
608
570
|
return this.GetNumber(__privateGet(this, _maxVelocity));
|
|
609
571
|
};
|
|
610
|
-
_GetDelta = new WeakSet();
|
|
611
572
|
GetDelta_fn = function() {
|
|
612
573
|
return this.GetNumber(__privateGet(this, _delta));
|
|
613
574
|
};
|
|
614
|
-
_GetTimeStamp = new WeakSet();
|
|
615
575
|
GetTimeStamp_fn = function() {
|
|
616
576
|
return this.GetNumber(__privateGet(this, _timeStamp));
|
|
617
577
|
};
|
|
618
|
-
_GetCountDiff = new WeakSet();
|
|
619
578
|
GetCountDiff_fn = function() {
|
|
620
579
|
return this.GetNumber(__privateGet(this, _countDiff));
|
|
621
580
|
};
|
|
622
|
-
_GetTimeDiff = new WeakSet();
|
|
623
581
|
GetTimeDiff_fn = function() {
|
|
624
582
|
return this.GetNumber(__privateGet(this, _timeDiff));
|
|
625
583
|
};
|
|
626
|
-
_GetDeltaCountDiff = new WeakSet();
|
|
627
584
|
GetDeltaCountDiff_fn = function() {
|
|
628
585
|
return this.GetNumber(__privateGet(this, _deltaCountDiff));
|
|
629
586
|
};
|
|
630
|
-
_GetDeltaTimeDif = new WeakSet();
|
|
631
587
|
GetDeltaTimeDif_fn = function() {
|
|
632
588
|
return this.GetNumber(__privateGet(this, _deltaTimeDif));
|
|
633
589
|
};
|
|
634
|
-
_GetAverageVelocity = new WeakSet();
|
|
635
590
|
GetAverageVelocity_fn = function() {
|
|
636
591
|
return __privateGet(this, _averageVelocity);
|
|
637
592
|
};
|
|
@@ -658,10 +613,7 @@ class InstrumentHistogramTelemetry extends InstrumentBaseTelemetry {
|
|
|
658
613
|
class InstrumentHistogram extends InstrumentBase {
|
|
659
614
|
constructor(options = {}) {
|
|
660
615
|
super(options);
|
|
661
|
-
__privateAdd(this,
|
|
662
|
-
__privateAdd(this, _SetVal2);
|
|
663
|
-
__privateAdd(this, _GetHistogramData);
|
|
664
|
-
__privateAdd(this, _SetHistogramData);
|
|
616
|
+
__privateAdd(this, _InstrumentHistogram_instances);
|
|
665
617
|
__privateAdd(this, _histogramData, []);
|
|
666
618
|
__privateAdd(this, _val, 0);
|
|
667
619
|
__privateAdd(this, _copy2, false);
|
|
@@ -714,16 +666,16 @@ class InstrumentHistogram extends InstrumentBase {
|
|
|
714
666
|
} else {
|
|
715
667
|
Object.defineProperty(this, "val", {
|
|
716
668
|
enumerable: true,
|
|
717
|
-
get: () => __privateMethod(this,
|
|
669
|
+
get: () => __privateMethod(this, _InstrumentHistogram_instances, GetVal_fn2).call(this),
|
|
718
670
|
set: (value) => {
|
|
719
|
-
__privateMethod(this,
|
|
671
|
+
__privateMethod(this, _InstrumentHistogram_instances, SetVal_fn2).call(this, value);
|
|
720
672
|
}
|
|
721
673
|
});
|
|
722
674
|
Object.defineProperty(this, "hist", {
|
|
723
675
|
enumerable: true,
|
|
724
|
-
get: () => __privateMethod(this,
|
|
676
|
+
get: () => __privateMethod(this, _InstrumentHistogram_instances, GetHistogramData_fn).call(this),
|
|
725
677
|
set: (value) => {
|
|
726
|
-
__privateMethod(this,
|
|
678
|
+
__privateMethod(this, _InstrumentHistogram_instances, SetHistogramData_fn).call(this, value);
|
|
727
679
|
}
|
|
728
680
|
});
|
|
729
681
|
}
|
|
@@ -869,20 +821,17 @@ class InstrumentHistogram extends InstrumentBase {
|
|
|
869
821
|
_histogramData = new WeakMap();
|
|
870
822
|
_val = new WeakMap();
|
|
871
823
|
_copy2 = new WeakMap();
|
|
872
|
-
|
|
824
|
+
_InstrumentHistogram_instances = new WeakSet();
|
|
873
825
|
GetVal_fn2 = function() {
|
|
874
826
|
return this.GetNumber(__privateGet(this, _val));
|
|
875
827
|
};
|
|
876
|
-
_SetVal2 = new WeakSet();
|
|
877
828
|
SetVal_fn2 = function(value) {
|
|
878
829
|
__privateSet(this, _val, value);
|
|
879
830
|
this.AddObservation(value);
|
|
880
831
|
};
|
|
881
|
-
_GetHistogramData = new WeakSet();
|
|
882
832
|
GetHistogramData_fn = function() {
|
|
883
833
|
return __privateGet(this, _histogramData);
|
|
884
834
|
};
|
|
885
|
-
_SetHistogramData = new WeakSet();
|
|
886
835
|
SetHistogramData_fn = function(value) {
|
|
887
836
|
__privateSet(this, _histogramData, value);
|
|
888
837
|
};
|
|
@@ -911,9 +860,7 @@ class InstrumentLogTelemetry extends InstrumentBaseTelemetry {
|
|
|
911
860
|
class InstrumentLog extends InstrumentBase {
|
|
912
861
|
constructor(options = {}) {
|
|
913
862
|
super(options);
|
|
914
|
-
__privateAdd(this,
|
|
915
|
-
__privateAdd(this, _GetVal3);
|
|
916
|
-
__privateAdd(this, _SetVal3);
|
|
863
|
+
__privateAdd(this, _InstrumentLog_instances);
|
|
917
864
|
__privateAdd(this, _messages, []);
|
|
918
865
|
__privateAdd(this, _readPos, 0);
|
|
919
866
|
__privateAdd(this, _maxSize, 200);
|
|
@@ -923,7 +870,7 @@ class InstrumentLog extends InstrumentBase {
|
|
|
923
870
|
__privateAdd(this, _consoleLogging, false);
|
|
924
871
|
__privateAdd(this, _instrumentLogging, true);
|
|
925
872
|
__privateAdd(this, _winstonLogging, false);
|
|
926
|
-
__privateAdd(this, _stsLogger
|
|
873
|
+
__privateAdd(this, _stsLogger);
|
|
927
874
|
__publicField(this, "val", []);
|
|
928
875
|
if (typeof options.label === "undefined") {
|
|
929
876
|
this.label = "InstrumentLog";
|
|
@@ -971,9 +918,9 @@ class InstrumentLog extends InstrumentBase {
|
|
|
971
918
|
} else {
|
|
972
919
|
Object.defineProperty(this, "val", {
|
|
973
920
|
enumerable: true,
|
|
974
|
-
get: () => _cloneDeep(__privateMethod(this,
|
|
921
|
+
get: () => _cloneDeep(__privateMethod(this, _InstrumentLog_instances, GetVal_fn3).call(this)),
|
|
975
922
|
set: (value) => {
|
|
976
|
-
__privateMethod(this,
|
|
923
|
+
__privateMethod(this, _InstrumentLog_instances, SetVal_fn3).call(this, value);
|
|
977
924
|
}
|
|
978
925
|
});
|
|
979
926
|
}
|
|
@@ -1013,7 +960,7 @@ class InstrumentLog extends InstrumentBase {
|
|
|
1013
960
|
set consoleLogging(value) {
|
|
1014
961
|
__privateSet(this, _consoleLogging, value);
|
|
1015
962
|
if (value === true) {
|
|
1016
|
-
__privateMethod(this,
|
|
963
|
+
__privateMethod(this, _InstrumentLog_instances, DumpToConsole_fn).call(this);
|
|
1017
964
|
}
|
|
1018
965
|
}
|
|
1019
966
|
get instrumentLogging() {
|
|
@@ -1028,32 +975,25 @@ class InstrumentLog extends InstrumentBase {
|
|
|
1028
975
|
}
|
|
1029
976
|
}
|
|
1030
977
|
error(message) {
|
|
1031
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1032
|
-
__privateGet(this, _stsLogger).error(message);
|
|
978
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).error(message);
|
|
1033
979
|
}
|
|
1034
980
|
warn(message) {
|
|
1035
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1036
|
-
__privateGet(this, _stsLogger).warn(message);
|
|
981
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).warn(message);
|
|
1037
982
|
}
|
|
1038
983
|
info(message) {
|
|
1039
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1040
|
-
__privateGet(this, _stsLogger).info(message);
|
|
984
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).info(message);
|
|
1041
985
|
}
|
|
1042
986
|
http(message) {
|
|
1043
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1044
|
-
__privateGet(this, _stsLogger).http(message);
|
|
987
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).http(message);
|
|
1045
988
|
}
|
|
1046
989
|
verbose(message) {
|
|
1047
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1048
|
-
__privateGet(this, _stsLogger).verbose(message);
|
|
990
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).verbose(message);
|
|
1049
991
|
}
|
|
1050
992
|
debug(message) {
|
|
1051
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1052
|
-
__privateGet(this, _stsLogger).debug(message);
|
|
993
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).debug(message);
|
|
1053
994
|
}
|
|
1054
995
|
silly(message) {
|
|
1055
|
-
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger))
|
|
1056
|
-
__privateGet(this, _stsLogger).silly(message);
|
|
996
|
+
if (__privateGet(this, _winstonLogging) && __privateGet(this, _stsLogger)) __privateGet(this, _stsLogger).silly(message);
|
|
1057
997
|
}
|
|
1058
998
|
LogMessage(message) {
|
|
1059
999
|
if (__privateGet(this, _copy3)) {
|
|
@@ -1108,14 +1048,13 @@ _consoleLogging = new WeakMap();
|
|
|
1108
1048
|
_instrumentLogging = new WeakMap();
|
|
1109
1049
|
_winstonLogging = new WeakMap();
|
|
1110
1050
|
_stsLogger = new WeakMap();
|
|
1111
|
-
|
|
1051
|
+
_InstrumentLog_instances = new WeakSet();
|
|
1112
1052
|
DumpToConsole_fn = function() {
|
|
1113
1053
|
const logReport = this.GetMessagesSinceLastRead();
|
|
1114
1054
|
for (let i = 0; i < logReport.length; i++) {
|
|
1115
1055
|
console.log(logReport[i]);
|
|
1116
1056
|
}
|
|
1117
1057
|
};
|
|
1118
|
-
_GetVal3 = new WeakSet();
|
|
1119
1058
|
GetVal_fn3 = function() {
|
|
1120
1059
|
if (__privateGet(this, _useLatestMessages)) {
|
|
1121
1060
|
return this.GetMessagesSinceLastRead();
|
|
@@ -1123,7 +1062,6 @@ GetVal_fn3 = function() {
|
|
|
1123
1062
|
return __privateGet(this, _messages);
|
|
1124
1063
|
}
|
|
1125
1064
|
};
|
|
1126
|
-
_SetVal3 = new WeakSet();
|
|
1127
1065
|
SetVal_fn3 = function(updatedValue) {
|
|
1128
1066
|
__privateSet(this, _messages, updatedValue);
|
|
1129
1067
|
__privateSet(this, _readPos, 0);
|
|
@@ -1147,9 +1085,7 @@ class InstrumentTimerTelemetry extends InstrumentBaseTelemetry {
|
|
|
1147
1085
|
class InstrumentTimerGauge extends InstrumentBase {
|
|
1148
1086
|
constructor(options = {}) {
|
|
1149
1087
|
super(options);
|
|
1150
|
-
__privateAdd(this,
|
|
1151
|
-
__privateAdd(this, _SetVal4);
|
|
1152
|
-
__privateAdd(this, _convertMS);
|
|
1088
|
+
__privateAdd(this, _InstrumentTimerGauge_instances);
|
|
1153
1089
|
__privateAdd(this, _start, 0);
|
|
1154
1090
|
__privateAdd(this, _copy4, false);
|
|
1155
1091
|
__privateAdd(this, _pauseVal, 0);
|
|
@@ -1175,9 +1111,9 @@ class InstrumentTimerGauge extends InstrumentBase {
|
|
|
1175
1111
|
} else {
|
|
1176
1112
|
Object.defineProperty(this, "val", {
|
|
1177
1113
|
enumerable: true,
|
|
1178
|
-
get: () => __privateMethod(this,
|
|
1114
|
+
get: () => __privateMethod(this, _InstrumentTimerGauge_instances, GetVal_fn4).call(this),
|
|
1179
1115
|
set: (value) => {
|
|
1180
|
-
__privateMethod(this,
|
|
1116
|
+
__privateMethod(this, _InstrumentTimerGauge_instances, SetVal_fn4).call(this, value);
|
|
1181
1117
|
}
|
|
1182
1118
|
});
|
|
1183
1119
|
}
|
|
@@ -1225,7 +1161,7 @@ class InstrumentTimerGauge extends InstrumentBase {
|
|
|
1225
1161
|
_start = new WeakMap();
|
|
1226
1162
|
_copy4 = new WeakMap();
|
|
1227
1163
|
_pauseVal = new WeakMap();
|
|
1228
|
-
|
|
1164
|
+
_InstrumentTimerGauge_instances = new WeakSet();
|
|
1229
1165
|
GetVal_fn4 = function() {
|
|
1230
1166
|
if (__privateGet(this, _pauseVal) !== 0) {
|
|
1231
1167
|
return this.GetNumber(__privateGet(this, _pauseVal));
|
|
@@ -1236,7 +1172,6 @@ GetVal_fn4 = function() {
|
|
|
1236
1172
|
return this.GetNumber(performance.now() - __privateGet(this, _start));
|
|
1237
1173
|
}
|
|
1238
1174
|
};
|
|
1239
|
-
_SetVal4 = new WeakSet();
|
|
1240
1175
|
SetVal_fn4 = function(updatedValue) {
|
|
1241
1176
|
if (isNode) {
|
|
1242
1177
|
__privateSet(this, _start, performance.now() - updatedValue);
|
|
@@ -1244,7 +1179,6 @@ SetVal_fn4 = function(updatedValue) {
|
|
|
1244
1179
|
__privateSet(this, _start, performance.now() - updatedValue);
|
|
1245
1180
|
}
|
|
1246
1181
|
};
|
|
1247
|
-
_convertMS = new WeakSet();
|
|
1248
1182
|
convertMS_fn = function(ms) {
|
|
1249
1183
|
let s = Math.floor(ms / 1e3);
|
|
1250
1184
|
let m = Math.floor(s / 60);
|
|
@@ -1897,8 +1831,7 @@ function validateInput(ps) {
|
|
|
1897
1831
|
}, []);
|
|
1898
1832
|
}
|
|
1899
1833
|
function getPsValue(p, list) {
|
|
1900
|
-
if (p === 0)
|
|
1901
|
-
return list[0];
|
|
1834
|
+
if (p === 0) return list[0];
|
|
1902
1835
|
var kIndex = Math.ceil(list.length * (p / 100)) - 1;
|
|
1903
1836
|
return list[kIndex];
|
|
1904
1837
|
}
|
|
@@ -1915,10 +1848,8 @@ function percentile(pOrPs, list, fn) {
|
|
|
1915
1848
|
}
|
|
1916
1849
|
a = Number.isNaN(a) ? Number.NEGATIVE_INFINITY : a;
|
|
1917
1850
|
b = Number.isNaN(b) ? Number.NEGATIVE_INFINITY : b;
|
|
1918
|
-
if (a > b)
|
|
1919
|
-
|
|
1920
|
-
if (a < b)
|
|
1921
|
-
return -1;
|
|
1851
|
+
if (a > b) return 1;
|
|
1852
|
+
if (a < b) return -1;
|
|
1922
1853
|
return 0;
|
|
1923
1854
|
});
|
|
1924
1855
|
if (ps.length === 1) {
|
|
@@ -1950,18 +1881,7 @@ class InstrumentGaugeTelemetry extends InstrumentBaseTelemetry {
|
|
|
1950
1881
|
class InstrumentGauge extends InstrumentBase {
|
|
1951
1882
|
constructor(options = {}) {
|
|
1952
1883
|
super(options);
|
|
1953
|
-
|
|
1954
|
-
* If the gauge is being monitored as part of a time series, get the most recent recorded value (max value) from within the time interval
|
|
1955
|
-
* otherwise, just return the current instant value.
|
|
1956
|
-
*/
|
|
1957
|
-
__privateAdd(this, _GetVal5);
|
|
1958
|
-
__privateAdd(this, _SetVal5);
|
|
1959
|
-
__privateAdd(this, _GetMin);
|
|
1960
|
-
__privateAdd(this, _GetMax);
|
|
1961
|
-
__privateAdd(this, _GetAverage);
|
|
1962
|
-
__privateAdd(this, _GetAndResetMaxVal);
|
|
1963
|
-
__privateAdd(this, _NumberCompare);
|
|
1964
|
-
__privateAdd(this, _GetPercentileData);
|
|
1884
|
+
__privateAdd(this, _InstrumentGauge_instances);
|
|
1965
1885
|
__privateAdd(this, _val2, 0);
|
|
1966
1886
|
__privateAdd(this, _maxval, null);
|
|
1967
1887
|
__privateAdd(this, _lastObservedValue, 0);
|
|
@@ -2015,15 +1935,15 @@ class InstrumentGauge extends InstrumentBase {
|
|
|
2015
1935
|
} else {
|
|
2016
1936
|
Object.defineProperty(this, "val", {
|
|
2017
1937
|
enumerable: true,
|
|
2018
|
-
get: () => __privateMethod(this,
|
|
1938
|
+
get: () => __privateMethod(this, _InstrumentGauge_instances, GetVal_fn5).call(this),
|
|
2019
1939
|
set: (value) => {
|
|
2020
|
-
__privateMethod(this,
|
|
1940
|
+
__privateMethod(this, _InstrumentGauge_instances, SetVal_fn5).call(this, value);
|
|
2021
1941
|
}
|
|
2022
1942
|
});
|
|
2023
1943
|
if (__privateGet(this, _timerInterval2) > 0) {
|
|
2024
1944
|
Object.defineProperty(this, "percentile", {
|
|
2025
1945
|
enumerable: true,
|
|
2026
|
-
get: () => __privateMethod(this,
|
|
1946
|
+
get: () => __privateMethod(this, _InstrumentGauge_instances, GetPercentileData_fn).call(this)
|
|
2027
1947
|
});
|
|
2028
1948
|
this._StartTimer();
|
|
2029
1949
|
}
|
|
@@ -2055,21 +1975,21 @@ class InstrumentGauge extends InstrumentBase {
|
|
|
2055
1975
|
WithMin() {
|
|
2056
1976
|
Object.defineProperty(this, "min", {
|
|
2057
1977
|
enumerable: true,
|
|
2058
|
-
get: () => __privateMethod(this,
|
|
1978
|
+
get: () => __privateMethod(this, _InstrumentGauge_instances, GetMin_fn).call(this)
|
|
2059
1979
|
});
|
|
2060
1980
|
return this;
|
|
2061
1981
|
}
|
|
2062
1982
|
WithMax() {
|
|
2063
1983
|
Object.defineProperty(this, "max", {
|
|
2064
1984
|
enumerable: true,
|
|
2065
|
-
get: () => __privateMethod(this,
|
|
1985
|
+
get: () => __privateMethod(this, _InstrumentGauge_instances, GetMax_fn).call(this)
|
|
2066
1986
|
});
|
|
2067
1987
|
return this;
|
|
2068
1988
|
}
|
|
2069
1989
|
WithAverage() {
|
|
2070
1990
|
Object.defineProperty(this, "avg", {
|
|
2071
1991
|
enumerable: true,
|
|
2072
|
-
get: () => __privateMethod(this,
|
|
1992
|
+
get: () => __privateMethod(this, _InstrumentGauge_instances, GetAverage_fn).call(this)
|
|
2073
1993
|
});
|
|
2074
1994
|
return this;
|
|
2075
1995
|
}
|
|
@@ -2080,7 +2000,7 @@ class InstrumentGauge extends InstrumentBase {
|
|
|
2080
2000
|
if (__privateGet(this, _timeSeriesList).length > __privateGet(this, _maxSampleSize)) {
|
|
2081
2001
|
__privateGet(this, _timeSeriesList).shift();
|
|
2082
2002
|
}
|
|
2083
|
-
const maxval = __privateMethod(this,
|
|
2003
|
+
const maxval = __privateMethod(this, _InstrumentGauge_instances, GetAndResetMaxVal_fn).call(this);
|
|
2084
2004
|
__privateGet(this, _timeSeriesList).push(maxval);
|
|
2085
2005
|
}, __privateGet(this, _timerInterval2)));
|
|
2086
2006
|
if (isNode) {
|
|
@@ -2111,10 +2031,10 @@ class InstrumentGauge extends InstrumentBase {
|
|
|
2111
2031
|
}
|
|
2112
2032
|
}
|
|
2113
2033
|
Inc(incVal = 1) {
|
|
2114
|
-
__privateMethod(this,
|
|
2034
|
+
__privateMethod(this, _InstrumentGauge_instances, SetVal_fn5).call(this, __privateGet(this, _val2) + incVal);
|
|
2115
2035
|
}
|
|
2116
2036
|
Dec(decVal = 1) {
|
|
2117
|
-
__privateMethod(this,
|
|
2037
|
+
__privateMethod(this, _InstrumentGauge_instances, SetVal_fn5).call(this, __privateGet(this, _val2) - decVal);
|
|
2118
2038
|
}
|
|
2119
2039
|
ProcessTelemetry(telemetry) {
|
|
2120
2040
|
if (telemetry.Inc) {
|
|
@@ -2140,7 +2060,11 @@ _max = new WeakMap();
|
|
|
2140
2060
|
_observations = new WeakMap();
|
|
2141
2061
|
_total = new WeakMap();
|
|
2142
2062
|
_copy5 = new WeakMap();
|
|
2143
|
-
|
|
2063
|
+
_InstrumentGauge_instances = new WeakSet();
|
|
2064
|
+
/**
|
|
2065
|
+
* If the gauge is being monitored as part of a time series, get the most recent recorded value (max value) from within the time interval
|
|
2066
|
+
* otherwise, just return the current instant value.
|
|
2067
|
+
*/
|
|
2144
2068
|
GetVal_fn5 = function() {
|
|
2145
2069
|
if (__privateGet(this, _timerInterval2) > 0 && __privateGet(this, _observer) !== null) {
|
|
2146
2070
|
if (__privateGet(this, _maxval) === null) {
|
|
@@ -2151,7 +2075,6 @@ GetVal_fn5 = function() {
|
|
|
2151
2075
|
}
|
|
2152
2076
|
return this.GetNumber(__privateGet(this, _val2));
|
|
2153
2077
|
};
|
|
2154
|
-
_SetVal5 = new WeakSet();
|
|
2155
2078
|
SetVal_fn5 = function(updatedValue) {
|
|
2156
2079
|
__privateSet(this, _val2, updatedValue);
|
|
2157
2080
|
__privateWrapper(this, _observations)._++;
|
|
@@ -2175,25 +2098,21 @@ SetVal_fn5 = function(updatedValue) {
|
|
|
2175
2098
|
}
|
|
2176
2099
|
}
|
|
2177
2100
|
};
|
|
2178
|
-
_GetMin = new WeakSet();
|
|
2179
2101
|
GetMin_fn = function() {
|
|
2180
2102
|
if (__privateGet(this, _min) !== null) {
|
|
2181
2103
|
return __privateGet(this, _min);
|
|
2182
2104
|
}
|
|
2183
2105
|
return 0;
|
|
2184
2106
|
};
|
|
2185
|
-
_GetMax = new WeakSet();
|
|
2186
2107
|
GetMax_fn = function() {
|
|
2187
2108
|
return __privateGet(this, _max);
|
|
2188
2109
|
};
|
|
2189
|
-
_GetAverage = new WeakSet();
|
|
2190
2110
|
GetAverage_fn = function() {
|
|
2191
2111
|
if (__privateGet(this, _observations) > 0) {
|
|
2192
2112
|
return __privateGet(this, _total) / __privateGet(this, _observations);
|
|
2193
2113
|
}
|
|
2194
2114
|
return 0;
|
|
2195
2115
|
};
|
|
2196
|
-
_GetAndResetMaxVal = new WeakSet();
|
|
2197
2116
|
GetAndResetMaxVal_fn = function() {
|
|
2198
2117
|
if (__privateGet(this, _maxval) === null) {
|
|
2199
2118
|
return __privateGet(this, _lastObservedValue);
|
|
@@ -2202,14 +2121,12 @@ GetAndResetMaxVal_fn = function() {
|
|
|
2202
2121
|
__privateSet(this, _maxval, null);
|
|
2203
2122
|
return retVal;
|
|
2204
2123
|
};
|
|
2205
|
-
_NumberCompare = new WeakSet();
|
|
2206
2124
|
NumberCompare_fn = function(a, b) {
|
|
2207
2125
|
return a - b;
|
|
2208
2126
|
};
|
|
2209
|
-
_GetPercentileData = new WeakSet();
|
|
2210
2127
|
GetPercentileData_fn = function() {
|
|
2211
2128
|
const sortedList = __privateGet(this, _timeSeriesList).slice(0);
|
|
2212
|
-
timsort.sort(sortedList, __privateMethod(this,
|
|
2129
|
+
timsort.sort(sortedList, __privateMethod(this, _InstrumentGauge_instances, NumberCompare_fn));
|
|
2213
2130
|
return percentile$1([50, 80, 90, 95, 99, 99.95], sortedList);
|
|
2214
2131
|
};
|
|
2215
2132
|
class InstrumentObjectOptions extends InstrumentBaseOptions {
|
|
@@ -2228,8 +2145,7 @@ class InstrumentObjectTelemetry extends InstrumentBaseTelemetry {
|
|
|
2228
2145
|
class InstrumentObject extends InstrumentBase {
|
|
2229
2146
|
constructor(options = {}) {
|
|
2230
2147
|
super(options);
|
|
2231
|
-
__privateAdd(this,
|
|
2232
|
-
__privateAdd(this, _SetVal6);
|
|
2148
|
+
__privateAdd(this, _InstrumentObject_instances);
|
|
2233
2149
|
__privateAdd(this, _val3, {});
|
|
2234
2150
|
__privateAdd(this, _copy6, false);
|
|
2235
2151
|
__publicField(this, "val");
|
|
@@ -2254,9 +2170,9 @@ class InstrumentObject extends InstrumentBase {
|
|
|
2254
2170
|
} else {
|
|
2255
2171
|
Object.defineProperty(this, "val", {
|
|
2256
2172
|
enumerable: true,
|
|
2257
|
-
get: () => __privateMethod(this,
|
|
2173
|
+
get: () => __privateMethod(this, _InstrumentObject_instances, GetVal_fn6).call(this),
|
|
2258
2174
|
set: (value) => {
|
|
2259
|
-
__privateMethod(this,
|
|
2175
|
+
__privateMethod(this, _InstrumentObject_instances, SetVal_fn6).call(this, value);
|
|
2260
2176
|
}
|
|
2261
2177
|
});
|
|
2262
2178
|
}
|
|
@@ -2282,11 +2198,10 @@ class InstrumentObject extends InstrumentBase {
|
|
|
2282
2198
|
}
|
|
2283
2199
|
_val3 = new WeakMap();
|
|
2284
2200
|
_copy6 = new WeakMap();
|
|
2285
|
-
|
|
2201
|
+
_InstrumentObject_instances = new WeakSet();
|
|
2286
2202
|
GetVal_fn6 = function() {
|
|
2287
2203
|
return __privateGet(this, _val3);
|
|
2288
2204
|
};
|
|
2289
|
-
_SetVal6 = new WeakSet();
|
|
2290
2205
|
SetVal_fn6 = function(updatedValue) {
|
|
2291
2206
|
__privateSet(this, _val3, updatedValue);
|
|
2292
2207
|
};
|
|
@@ -2557,8 +2472,7 @@ var ansiStyles$1 = { exports: {} };
|
|
|
2557
2472
|
var colorName;
|
|
2558
2473
|
var hasRequiredColorName;
|
|
2559
2474
|
function requireColorName() {
|
|
2560
|
-
if (hasRequiredColorName)
|
|
2561
|
-
return colorName;
|
|
2475
|
+
if (hasRequiredColorName) return colorName;
|
|
2562
2476
|
hasRequiredColorName = 1;
|
|
2563
2477
|
colorName = {
|
|
2564
2478
|
"aliceblue": [240, 248, 255],
|
|
@@ -2715,8 +2629,7 @@ function requireColorName() {
|
|
|
2715
2629
|
var conversions;
|
|
2716
2630
|
var hasRequiredConversions;
|
|
2717
2631
|
function requireConversions() {
|
|
2718
|
-
if (hasRequiredConversions)
|
|
2719
|
-
return conversions;
|
|
2632
|
+
if (hasRequiredConversions) return conversions;
|
|
2720
2633
|
hasRequiredConversions = 1;
|
|
2721
2634
|
const cssKeywords = requireColorName();
|
|
2722
2635
|
const reverseKeywords = {};
|
|
@@ -3388,8 +3301,7 @@ function requireConversions() {
|
|
|
3388
3301
|
var route;
|
|
3389
3302
|
var hasRequiredRoute;
|
|
3390
3303
|
function requireRoute() {
|
|
3391
|
-
if (hasRequiredRoute)
|
|
3392
|
-
return route;
|
|
3304
|
+
if (hasRequiredRoute) return route;
|
|
3393
3305
|
hasRequiredRoute = 1;
|
|
3394
3306
|
const conversions2 = requireConversions();
|
|
3395
3307
|
function buildGraph() {
|
|
@@ -3460,8 +3372,7 @@ function requireRoute() {
|
|
|
3460
3372
|
var colorConvert;
|
|
3461
3373
|
var hasRequiredColorConvert;
|
|
3462
3374
|
function requireColorConvert() {
|
|
3463
|
-
if (hasRequiredColorConvert)
|
|
3464
|
-
return colorConvert;
|
|
3375
|
+
if (hasRequiredColorConvert) return colorConvert;
|
|
3465
3376
|
hasRequiredColorConvert = 1;
|
|
3466
3377
|
const conversions2 = requireConversions();
|
|
3467
3378
|
const route2 = requireRoute();
|
|
@@ -3698,8 +3609,7 @@ var util = {
|
|
|
3698
3609
|
var templates;
|
|
3699
3610
|
var hasRequiredTemplates;
|
|
3700
3611
|
function requireTemplates() {
|
|
3701
|
-
if (hasRequiredTemplates)
|
|
3702
|
-
return templates;
|
|
3612
|
+
if (hasRequiredTemplates) return templates;
|
|
3703
3613
|
hasRequiredTemplates = 1;
|
|
3704
3614
|
const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
3705
3615
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
@@ -3991,14 +3901,7 @@ var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
|
|
|
3991
3901
|
class PublishInstrumentController extends STSOptionsBase {
|
|
3992
3902
|
constructor(options) {
|
|
3993
3903
|
super(options);
|
|
3994
|
-
__privateAdd(this,
|
|
3995
|
-
__privateAdd(this, _ProcessTelemetryCommand);
|
|
3996
|
-
// Instrument factory
|
|
3997
|
-
__privateAdd(this, _CreateInstrument);
|
|
3998
|
-
__privateAdd(this, _CreateInstruments);
|
|
3999
|
-
__privateAdd(this, _GetPayloadData);
|
|
4000
|
-
__privateAdd(this, _PublishTimeoutLoop);
|
|
4001
|
-
__privateAdd(this, _UpdateState);
|
|
3904
|
+
__privateAdd(this, _PublishInstrumentController_instances);
|
|
4002
3905
|
__privateAdd(this, _instruments, {});
|
|
4003
3906
|
__privateAdd(this, _inPublish, false);
|
|
4004
3907
|
__privateAdd(this, _observer2, null);
|
|
@@ -4008,7 +3911,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4008
3911
|
LogMessage: message
|
|
4009
3912
|
});
|
|
4010
3913
|
});
|
|
4011
|
-
__privateMethod(this,
|
|
3914
|
+
__privateMethod(this, _PublishInstrumentController_instances, UpdateState_fn).call(this, 0, "constructor()");
|
|
4012
3915
|
this.SetupInstrumentation();
|
|
4013
3916
|
this.StartPublish();
|
|
4014
3917
|
}
|
|
@@ -4022,7 +3925,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4022
3925
|
try {
|
|
4023
3926
|
__privateSet(this, _inPublish, true);
|
|
4024
3927
|
if (Object.keys(__privateGet(this, _instruments)).length > 0) {
|
|
4025
|
-
const instrumentPayload = __privateMethod(this,
|
|
3928
|
+
const instrumentPayload = __privateMethod(this, _PublishInstrumentController_instances, GetPayloadData_fn).call(this, this.options.processContext, __privateGet(this, _instruments));
|
|
4026
3929
|
return await this.options.publisherTransport.Publish(instrumentPayload);
|
|
4027
3930
|
} else {
|
|
4028
3931
|
return true;
|
|
@@ -4038,8 +3941,8 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4038
3941
|
this.options.logger.debug(chalk$1.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state. Current State: [${__privateGet(this, _publishState)}]`));
|
|
4039
3942
|
return false;
|
|
4040
3943
|
}
|
|
4041
|
-
__privateMethod(this,
|
|
4042
|
-
__privateMethod(this,
|
|
3944
|
+
__privateMethod(this, _PublishInstrumentController_instances, UpdateState_fn).call(this, 1, "StartPublish()");
|
|
3945
|
+
__privateMethod(this, _PublishInstrumentController_instances, PublishTimeoutLoop_fn).call(this, this.options.publishInterval);
|
|
4043
3946
|
return true;
|
|
4044
3947
|
}
|
|
4045
3948
|
async EndPublish() {
|
|
@@ -4047,14 +3950,14 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4047
3950
|
this.options.logger.debug(chalk$1.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state. Current State: [${__privateGet(this, _publishState)}]`));
|
|
4048
3951
|
return false;
|
|
4049
3952
|
}
|
|
4050
|
-
__privateMethod(this,
|
|
3953
|
+
__privateMethod(this, _PublishInstrumentController_instances, UpdateState_fn).call(this, 2, "EndPublish() (1)");
|
|
4051
3954
|
if (__privateGet(this, _observer2) !== null) {
|
|
4052
3955
|
clearInterval(__privateGet(this, _observer2));
|
|
4053
3956
|
__privateSet(this, _observer2, null);
|
|
4054
3957
|
await this.Publish();
|
|
4055
3958
|
}
|
|
4056
3959
|
await this.options.publisherTransport.Close();
|
|
4057
|
-
__privateMethod(this,
|
|
3960
|
+
__privateMethod(this, _PublishInstrumentController_instances, UpdateState_fn).call(this, 0, "EndPublish() (2)");
|
|
4058
3961
|
return true;
|
|
4059
3962
|
}
|
|
4060
3963
|
SetupInstrumentation() {
|
|
@@ -4066,7 +3969,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4066
3969
|
this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation: No context defined within supplied options.`));
|
|
4067
3970
|
return;
|
|
4068
3971
|
}
|
|
4069
|
-
__privateMethod(this,
|
|
3972
|
+
__privateMethod(this, _PublishInstrumentController_instances, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
|
|
4070
3973
|
}
|
|
4071
3974
|
/**
|
|
4072
3975
|
* Check if an instrument exists within the managed instrument collection
|
|
@@ -4086,7 +3989,7 @@ class PublishInstrumentController extends STSOptionsBase {
|
|
|
4086
3989
|
*/
|
|
4087
3990
|
UpdateInstrument(instrumentName, telemetry) {
|
|
4088
3991
|
if (__privateGet(this, _instruments)[instrumentName]) {
|
|
4089
|
-
__privateMethod(this,
|
|
3992
|
+
__privateMethod(this, _PublishInstrumentController_instances, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
|
|
4090
3993
|
} else {
|
|
4091
3994
|
this.options.logger.debug(chalk$1.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
|
|
4092
3995
|
}
|
|
@@ -4211,18 +4114,17 @@ _instruments = new WeakMap();
|
|
|
4211
4114
|
_inPublish = new WeakMap();
|
|
4212
4115
|
_observer2 = new WeakMap();
|
|
4213
4116
|
_publishState = new WeakMap();
|
|
4214
|
-
|
|
4117
|
+
_PublishInstrumentController_instances = new WeakSet();
|
|
4215
4118
|
GetInstrument_fn = function(instrumentName) {
|
|
4216
4119
|
return __privateGet(this, _instruments)[instrumentName];
|
|
4217
4120
|
};
|
|
4218
|
-
_ProcessTelemetryCommand = new WeakSet();
|
|
4219
4121
|
ProcessTelemetryCommand_fn = function(instrumentName, telemetry) {
|
|
4220
|
-
const instrument = __privateMethod(this,
|
|
4122
|
+
const instrument = __privateMethod(this, _PublishInstrumentController_instances, GetInstrument_fn).call(this, instrumentName);
|
|
4221
4123
|
if (instrument) {
|
|
4222
4124
|
instrument.ProcessTelemetry(telemetry);
|
|
4223
4125
|
}
|
|
4224
4126
|
};
|
|
4225
|
-
|
|
4127
|
+
// Instrument factory
|
|
4226
4128
|
CreateInstrument_fn = function(instrumentType, options) {
|
|
4227
4129
|
let instrument;
|
|
4228
4130
|
switch (instrumentType) {
|
|
@@ -4249,17 +4151,15 @@ CreateInstrument_fn = function(instrumentType, options) {
|
|
|
4249
4151
|
}
|
|
4250
4152
|
return instrument;
|
|
4251
4153
|
};
|
|
4252
|
-
_CreateInstruments = new WeakSet();
|
|
4253
4154
|
CreateInstruments_fn = function(payload) {
|
|
4254
4155
|
payload.forEach((instrumentDefinition) => {
|
|
4255
4156
|
const g = instrumentDefinition[0];
|
|
4256
4157
|
const gt = instrumentDefinition[1];
|
|
4257
4158
|
const instrumentBaseOptions = instrumentDefinition[2];
|
|
4258
|
-
const instrument = __privateMethod(this,
|
|
4159
|
+
const instrument = __privateMethod(this, _PublishInstrumentController_instances, CreateInstrument_fn).call(this, gt, instrumentBaseOptions);
|
|
4259
4160
|
__privateGet(this, _instruments)[g] = instrument;
|
|
4260
4161
|
});
|
|
4261
4162
|
};
|
|
4262
|
-
_GetPayloadData = new WeakSet();
|
|
4263
4163
|
GetPayloadData_fn = function(context, instruments) {
|
|
4264
4164
|
const payloadInstruments = {};
|
|
4265
4165
|
for (const [key, value] of Object.entries(instruments)) {
|
|
@@ -4274,7 +4174,6 @@ GetPayloadData_fn = function(context, instruments) {
|
|
|
4274
4174
|
instruments: payloadInstruments
|
|
4275
4175
|
};
|
|
4276
4176
|
};
|
|
4277
|
-
_PublishTimeoutLoop = new WeakSet();
|
|
4278
4177
|
PublishTimeoutLoop_fn = function(publishInterval) {
|
|
4279
4178
|
__privateSet(this, _observer2, setTimeout(async () => {
|
|
4280
4179
|
const start = performance.now();
|
|
@@ -4282,13 +4181,11 @@ PublishTimeoutLoop_fn = function(publishInterval) {
|
|
|
4282
4181
|
const end = performance.now();
|
|
4283
4182
|
const diff = end - start;
|
|
4284
4183
|
if (__privateGet(this, _publishState) === 1) {
|
|
4285
|
-
__privateMethod(this,
|
|
4184
|
+
__privateMethod(this, _PublishInstrumentController_instances, PublishTimeoutLoop_fn).call(this, this.options.publishInterval - diff);
|
|
4286
4185
|
}
|
|
4287
4186
|
}, publishInterval));
|
|
4288
|
-
if (isNode)
|
|
4289
|
-
__privateGet(this, _observer2).unref();
|
|
4187
|
+
if (isNode) __privateGet(this, _observer2).unref();
|
|
4290
4188
|
};
|
|
4291
|
-
_UpdateState = new WeakSet();
|
|
4292
4189
|
UpdateState_fn = function(newState, comment) {
|
|
4293
4190
|
const previousState = __privateGet(this, _publishState);
|
|
4294
4191
|
__privateSet(this, _publishState, newState);
|
|
@@ -4431,9 +4328,7 @@ var __extends = /* @__PURE__ */ function() {
|
|
|
4431
4328
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
4432
4329
|
d2.__proto__ = b2;
|
|
4433
4330
|
} || function(d2, b2) {
|
|
4434
|
-
for (var p in b2)
|
|
4435
|
-
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
4436
|
-
d2[p] = b2[p];
|
|
4331
|
+
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
4437
4332
|
};
|
|
4438
4333
|
return extendStatics(d, b);
|
|
4439
4334
|
};
|
|
@@ -4983,7 +4878,7 @@ function encode(value, options) {
|
|
|
4983
4878
|
class PublishTransportRESTServer extends STSOptionsBase {
|
|
4984
4879
|
constructor(options) {
|
|
4985
4880
|
super(options);
|
|
4986
|
-
__privateAdd(this, _httpsAgent
|
|
4881
|
+
__privateAdd(this, _httpsAgent);
|
|
4987
4882
|
// Returns true for success or false for failure.
|
|
4988
4883
|
__publicField(this, "Publish", async (payload) => {
|
|
4989
4884
|
try {
|
|
@@ -5617,7 +5512,7 @@ let ObservabilityModelUtils = _ObservabilityModelUtils;
|
|
|
5617
5512
|
class KafkaHelper {
|
|
5618
5513
|
constructor(options) {
|
|
5619
5514
|
__privateAdd(this, _kafkaLog, {});
|
|
5620
|
-
__privateAdd(this, _maxLogLength
|
|
5515
|
+
__privateAdd(this, _maxLogLength);
|
|
5621
5516
|
__publicField(this, "GetKafkaLogData", (kafkaTopic, modelNode) => {
|
|
5622
5517
|
if (__privateGet(this, _kafkaLog)[kafkaTopic]) {
|
|
5623
5518
|
modelNode.instruments[Gauge.LOGGER] = ObservabilityModelUtils.GetModelNodeRawStringArray(__privateGet(this, _kafkaLog)[kafkaTopic].kafkaLog);
|
|
@@ -5648,19 +5543,14 @@ _kafkaLog = new WeakMap();
|
|
|
5648
5543
|
_maxLogLength = new WeakMap();
|
|
5649
5544
|
class ObservabilityRESTAPISubscriber {
|
|
5650
5545
|
constructor(options) {
|
|
5651
|
-
__privateAdd(this,
|
|
5652
|
-
__privateAdd(this, _LogErrorMessage);
|
|
5653
|
-
__privateAdd(this, _InvokeRESTAPI);
|
|
5654
|
-
__privateAdd(this, _SetupTimeout);
|
|
5655
|
-
__privateAdd(this, _AddKeepAlive);
|
|
5656
|
-
__privateAdd(this, _RemoveKeepAlive);
|
|
5546
|
+
__privateAdd(this, _ObservabilityRESTAPISubscriber_instances);
|
|
5657
5547
|
__privateAdd(this, _socketSubscribeKeepAlive, {});
|
|
5658
|
-
__privateAdd(this, _options2
|
|
5548
|
+
__privateAdd(this, _options2);
|
|
5659
5549
|
// This is required becuase each call to .bind create a new replica bound function - so we need the same instance for on/off event bindings.
|
|
5660
5550
|
__publicField(this, "KeepAliveAckBoundFunction");
|
|
5661
5551
|
__privateAdd(this, _GetData, async (subscription) => {
|
|
5662
5552
|
try {
|
|
5663
|
-
const retVal = await __privateMethod(this,
|
|
5553
|
+
const retVal = await __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, InvokeRESTAPI_fn).call(this, subscription);
|
|
5664
5554
|
if (retVal) {
|
|
5665
5555
|
const payload = {
|
|
5666
5556
|
subscriptionKey: subscription.subscriptionKey,
|
|
@@ -5669,8 +5559,8 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5669
5559
|
subscription.cb(payload);
|
|
5670
5560
|
}
|
|
5671
5561
|
} catch (error) {
|
|
5672
|
-
__privateMethod(this,
|
|
5673
|
-
__privateMethod(this,
|
|
5562
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5563
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
|
|
5674
5564
|
}
|
|
5675
5565
|
});
|
|
5676
5566
|
__privateSet(this, _options2, options);
|
|
@@ -5680,13 +5570,13 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5680
5570
|
}
|
|
5681
5571
|
async Subscribe(subscriptions) {
|
|
5682
5572
|
subscriptions.map(async (subId) => {
|
|
5683
|
-
__privateMethod(this,
|
|
5684
|
-
__privateMethod(this,
|
|
5573
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5574
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5685
5575
|
try {
|
|
5686
|
-
__privateMethod(this,
|
|
5576
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, AddKeepAlive_fn).call(this, subId);
|
|
5687
5577
|
} catch (error) {
|
|
5688
|
-
__privateMethod(this,
|
|
5689
|
-
__privateMethod(this,
|
|
5578
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
5579
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5690
5580
|
}
|
|
5691
5581
|
});
|
|
5692
5582
|
}
|
|
@@ -5695,22 +5585,20 @@ class ObservabilityRESTAPISubscriber {
|
|
|
5695
5585
|
}
|
|
5696
5586
|
UnSubscribe(subscriptions) {
|
|
5697
5587
|
subscriptions.map(async (subId) => {
|
|
5698
|
-
__privateMethod(this,
|
|
5699
|
-
__privateMethod(this,
|
|
5588
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
|
|
5589
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
5700
5590
|
});
|
|
5701
5591
|
}
|
|
5702
5592
|
}
|
|
5703
5593
|
_socketSubscribeKeepAlive = new WeakMap();
|
|
5704
5594
|
_options2 = new WeakMap();
|
|
5705
|
-
|
|
5595
|
+
_ObservabilityRESTAPISubscriber_instances = new WeakSet();
|
|
5706
5596
|
LogDebugMessage_fn = function(message) {
|
|
5707
5597
|
__privateGet(this, _options2).logger.debug(message);
|
|
5708
5598
|
};
|
|
5709
|
-
_LogErrorMessage = new WeakSet();
|
|
5710
5599
|
LogErrorMessage_fn = function(message) {
|
|
5711
5600
|
__privateGet(this, _options2).logger.error(message);
|
|
5712
5601
|
};
|
|
5713
|
-
_InvokeRESTAPI = new WeakSet();
|
|
5714
5602
|
InvokeRESTAPI_fn = async function(subscription) {
|
|
5715
5603
|
const { subscriptionKey } = subscription;
|
|
5716
5604
|
let url = "";
|
|
@@ -5820,7 +5708,6 @@ InvokeRESTAPI_fn = async function(subscription) {
|
|
|
5820
5708
|
}
|
|
5821
5709
|
};
|
|
5822
5710
|
_GetData = new WeakMap();
|
|
5823
|
-
_SetupTimeout = new WeakSet();
|
|
5824
5711
|
SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
|
|
5825
5712
|
return setTimeout(async () => {
|
|
5826
5713
|
try {
|
|
@@ -5833,30 +5720,28 @@ SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
|
|
|
5833
5720
|
if (timeoutDuration < 500) {
|
|
5834
5721
|
timeoutDuration = 500;
|
|
5835
5722
|
}
|
|
5836
|
-
socketSubscribeKeepAlive.timeout = __privateMethod(this,
|
|
5723
|
+
socketSubscribeKeepAlive.timeout = __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
|
|
5837
5724
|
} else {
|
|
5838
|
-
__privateMethod(this,
|
|
5725
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
|
|
5839
5726
|
}
|
|
5840
5727
|
} catch (error) {
|
|
5841
|
-
__privateMethod(this,
|
|
5842
|
-
__privateMethod(this,
|
|
5728
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
5729
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
|
|
5843
5730
|
}
|
|
5844
5731
|
}, timeout);
|
|
5845
5732
|
};
|
|
5846
|
-
_AddKeepAlive = new WeakSet();
|
|
5847
5733
|
AddKeepAlive_fn = function(subscription) {
|
|
5848
|
-
__privateMethod(this,
|
|
5734
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
|
|
5849
5735
|
const socketSubscribeKeepAlive = {
|
|
5850
5736
|
id: subscription.subscriptionKey.id
|
|
5851
5737
|
};
|
|
5852
|
-
socketSubscribeKeepAlive.timeout = __privateMethod(this,
|
|
5738
|
+
socketSubscribeKeepAlive.timeout = __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, __privateGet(this, _options2).keepAlive);
|
|
5853
5739
|
__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id] = socketSubscribeKeepAlive;
|
|
5854
5740
|
__privateGet(this, _GetData).call(this, subscription);
|
|
5855
5741
|
};
|
|
5856
|
-
_RemoveKeepAlive = new WeakSet();
|
|
5857
5742
|
RemoveKeepAlive_fn = function(subscription) {
|
|
5858
5743
|
if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
|
|
5859
|
-
__privateMethod(this,
|
|
5744
|
+
__privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
5860
5745
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
|
|
5861
5746
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
|
|
5862
5747
|
delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
|
|
@@ -5918,15 +5803,14 @@ var messageStatusResponse = /* @__PURE__ */ ((messageStatusResponse2) => {
|
|
|
5918
5803
|
})(messageStatusResponse || {});
|
|
5919
5804
|
class SocketIoMessageSender {
|
|
5920
5805
|
constructor(options) {
|
|
5921
|
-
__privateAdd(this,
|
|
5922
|
-
__privateAdd(this, _GetSubscribeKeepAliveAckEventName);
|
|
5806
|
+
__privateAdd(this, _SocketIoMessageSender_instances);
|
|
5923
5807
|
__privateAdd(this, _messageWithAckPayloadRecords, {});
|
|
5924
|
-
__privateAdd(this, _socket
|
|
5808
|
+
__privateAdd(this, _socket);
|
|
5925
5809
|
__privateAdd(this, _maxReties, 3);
|
|
5926
5810
|
//@@
|
|
5927
5811
|
__privateAdd(this, _timeoutValue, 5e3);
|
|
5928
5812
|
//@@
|
|
5929
|
-
__privateAdd(this, _options3
|
|
5813
|
+
__privateAdd(this, _options3);
|
|
5930
5814
|
__privateSet(this, _options3, options);
|
|
5931
5815
|
__privateSet(this, _socket, options.socket);
|
|
5932
5816
|
}
|
|
@@ -5934,38 +5818,38 @@ class SocketIoMessageSender {
|
|
|
5934
5818
|
return __privateGet(this, _socket);
|
|
5935
5819
|
}
|
|
5936
5820
|
set socket(socket) {
|
|
5937
|
-
__privateMethod(this,
|
|
5821
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
|
|
5938
5822
|
__privateSet(this, _socket, socket);
|
|
5939
5823
|
}
|
|
5940
5824
|
AckListener(message, payload) {
|
|
5941
5825
|
if (message.subscriptionKey.id.localeCompare(payload.id) === 0) {
|
|
5942
5826
|
clearTimeout(message.timeoutId);
|
|
5943
5827
|
delete message.timeoutId;
|
|
5944
|
-
__privateGet(this, _socket).off(__privateMethod(this,
|
|
5828
|
+
__privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5945
5829
|
message.endTime = performance.now();
|
|
5946
5830
|
message.duration = message.endTime - message.startTime;
|
|
5947
5831
|
message.status = "SUCCESS";
|
|
5948
5832
|
message.subscriptionKeyResponse = payload;
|
|
5949
5833
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5950
|
-
__privateMethod(this,
|
|
5834
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5951
5835
|
message.resolve(message);
|
|
5952
5836
|
}
|
|
5953
5837
|
}
|
|
5954
5838
|
ResponseTimout(message) {
|
|
5955
|
-
__privateMethod(this,
|
|
5839
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5956
5840
|
delete message.timeoutId;
|
|
5957
|
-
__privateGet(this, _socket).off(__privateMethod(this,
|
|
5841
|
+
__privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5958
5842
|
message.endTime = performance.now();
|
|
5959
5843
|
if (message.retryCount >= __privateGet(this, _maxReties)) {
|
|
5960
5844
|
message.status = "FAIL";
|
|
5961
|
-
__privateMethod(this,
|
|
5845
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5962
5846
|
delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
|
|
5963
5847
|
message.reject(message);
|
|
5964
5848
|
return;
|
|
5965
5849
|
}
|
|
5966
5850
|
message.status = "INRETRY";
|
|
5967
5851
|
message.retryCount++;
|
|
5968
|
-
__privateMethod(this,
|
|
5852
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5969
5853
|
this.SendMessage(message);
|
|
5970
5854
|
}
|
|
5971
5855
|
SendMessage(message) {
|
|
@@ -5977,8 +5861,8 @@ class SocketIoMessageSender {
|
|
|
5977
5861
|
this.AckListener(message, payload);
|
|
5978
5862
|
};
|
|
5979
5863
|
message.BoundAckListenerCallback = AckListenerCallback.bind(this);
|
|
5980
|
-
__privateGet(this, _socket).on(__privateMethod(this,
|
|
5981
|
-
__privateMethod(this,
|
|
5864
|
+
__privateGet(this, _socket).on(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
5865
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
5982
5866
|
__privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
|
|
5983
5867
|
}
|
|
5984
5868
|
SendMessageWithAck(eventName, subscriptionKey) {
|
|
@@ -6002,10 +5886,10 @@ class SocketIoMessageSender {
|
|
|
6002
5886
|
const killIds = [];
|
|
6003
5887
|
for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
|
|
6004
5888
|
if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
|
|
6005
|
-
__privateMethod(this,
|
|
5889
|
+
__privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
|
|
6006
5890
|
clearTimeout(message.timeoutId);
|
|
6007
5891
|
delete message.timeoutId;
|
|
6008
|
-
__privateGet(this, _socket).off(__privateMethod(this,
|
|
5892
|
+
__privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
|
|
6009
5893
|
killIds.push(message.id);
|
|
6010
5894
|
message.status = "KILLED";
|
|
6011
5895
|
message.reject(message);
|
|
@@ -6021,24 +5905,20 @@ _socket = new WeakMap();
|
|
|
6021
5905
|
_maxReties = new WeakMap();
|
|
6022
5906
|
_timeoutValue = new WeakMap();
|
|
6023
5907
|
_options3 = new WeakMap();
|
|
6024
|
-
|
|
5908
|
+
_SocketIoMessageSender_instances = new WeakSet();
|
|
6025
5909
|
LogDebugMessage_fn2 = function(message) {
|
|
6026
5910
|
__privateGet(this, _options3).logger.debug(message);
|
|
6027
5911
|
};
|
|
6028
|
-
_GetSubscribeKeepAliveAckEventName = new WeakSet();
|
|
6029
5912
|
GetSubscribeKeepAliveAckEventName_fn = function(eventName, subscriptionKey) {
|
|
6030
5913
|
return `${eventName}Ack_${subscriptionKey.id}`;
|
|
6031
5914
|
};
|
|
6032
5915
|
class ObservabilitySocketIOSubscriber {
|
|
6033
5916
|
constructor(options) {
|
|
6034
|
-
__privateAdd(this,
|
|
6035
|
-
__privateAdd(this, _LogErrorMessage2);
|
|
6036
|
-
__privateAdd(this, _AddKeepAlive2);
|
|
6037
|
-
__privateAdd(this, _RemoveKeepAlive2);
|
|
5917
|
+
__privateAdd(this, _ObservabilitySocketIOSubscriber_instances);
|
|
6038
5918
|
__privateAdd(this, _socketSubscribeKeepAlive2, {});
|
|
6039
|
-
__privateAdd(this, _socket2
|
|
6040
|
-
__privateAdd(this, _options4
|
|
6041
|
-
__privateAdd(this, _socketIoMessageSender
|
|
5919
|
+
__privateAdd(this, _socket2);
|
|
5920
|
+
__privateAdd(this, _options4);
|
|
5921
|
+
__privateAdd(this, _socketIoMessageSender);
|
|
6042
5922
|
// This is required becuase each call to .bind create a new replica bound function - so we need the same instance for on/off event bindings.
|
|
6043
5923
|
__publicField(this, "KeepAliveAckBoundFunction");
|
|
6044
5924
|
__privateSet(this, _options4, options);
|
|
@@ -6052,7 +5932,7 @@ class ObservabilitySocketIOSubscriber {
|
|
|
6052
5932
|
return __privateGet(this, _socket2);
|
|
6053
5933
|
}
|
|
6054
5934
|
set socket(socket) {
|
|
6055
|
-
__privateMethod(this,
|
|
5935
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
|
|
6056
5936
|
__privateSet(this, _socket2, socket);
|
|
6057
5937
|
__privateGet(this, _socketIoMessageSender).socket = socket;
|
|
6058
5938
|
}
|
|
@@ -6062,17 +5942,17 @@ class ObservabilitySocketIOSubscriber {
|
|
|
6062
5942
|
async Subscribe(subscriptions) {
|
|
6063
5943
|
const socket = __privateGet(this, _socket2);
|
|
6064
5944
|
subscriptions.map(async (subId) => {
|
|
6065
|
-
__privateMethod(this,
|
|
6066
|
-
__privateMethod(this,
|
|
5945
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
5946
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
6067
5947
|
try {
|
|
6068
5948
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
|
|
6069
|
-
__privateMethod(this,
|
|
6070
|
-
__privateMethod(this,
|
|
5949
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
5950
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subId);
|
|
6071
5951
|
socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
6072
5952
|
} catch (error) {
|
|
6073
|
-
__privateMethod(this,
|
|
5953
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
|
|
6074
5954
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
6075
|
-
__privateMethod(this,
|
|
5955
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
6076
5956
|
}
|
|
6077
5957
|
});
|
|
6078
5958
|
}
|
|
@@ -6083,14 +5963,14 @@ class ObservabilitySocketIOSubscriber {
|
|
|
6083
5963
|
const socket = __privateGet(this, _socket2);
|
|
6084
5964
|
subscriptions.map(async (subId) => {
|
|
6085
5965
|
socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
|
|
6086
|
-
__privateMethod(this,
|
|
5966
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
|
|
6087
5967
|
__privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
|
|
6088
|
-
__privateMethod(this,
|
|
5968
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
|
|
6089
5969
|
try {
|
|
6090
5970
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
|
|
6091
|
-
__privateMethod(this,
|
|
5971
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
6092
5972
|
} catch (error) {
|
|
6093
|
-
__privateMethod(this,
|
|
5973
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
|
|
6094
5974
|
}
|
|
6095
5975
|
});
|
|
6096
5976
|
}
|
|
@@ -6112,52 +5992,48 @@ _socketSubscribeKeepAlive2 = new WeakMap();
|
|
|
6112
5992
|
_socket2 = new WeakMap();
|
|
6113
5993
|
_options4 = new WeakMap();
|
|
6114
5994
|
_socketIoMessageSender = new WeakMap();
|
|
6115
|
-
|
|
5995
|
+
_ObservabilitySocketIOSubscriber_instances = new WeakSet();
|
|
6116
5996
|
LogDebugMessage_fn3 = function(message) {
|
|
6117
5997
|
__privateGet(this, _options4).logger.debug(message);
|
|
6118
5998
|
};
|
|
6119
|
-
_LogErrorMessage2 = new WeakSet();
|
|
6120
5999
|
LogErrorMessage_fn2 = function(message) {
|
|
6121
6000
|
__privateGet(this, _options4).logger.error(message);
|
|
6122
6001
|
};
|
|
6123
|
-
_AddKeepAlive2 = new WeakSet();
|
|
6124
6002
|
AddKeepAlive_fn2 = function(socket, subscription) {
|
|
6125
|
-
__privateMethod(this,
|
|
6003
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subscription);
|
|
6126
6004
|
__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
|
|
6127
6005
|
id: subscription.subscriptionKey.id,
|
|
6128
6006
|
timeout: setTimeout(async () => {
|
|
6129
|
-
__privateMethod(this,
|
|
6007
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
6130
6008
|
try {
|
|
6131
6009
|
const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
|
|
6132
|
-
__privateMethod(this,
|
|
6133
|
-
__privateMethod(this,
|
|
6010
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
|
|
6011
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subscription);
|
|
6134
6012
|
} catch (error) {
|
|
6135
|
-
__privateMethod(this,
|
|
6013
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
|
|
6136
6014
|
socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
|
|
6137
|
-
__privateMethod(this,
|
|
6015
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subscription);
|
|
6138
6016
|
}
|
|
6139
6017
|
}, __privateGet(this, _options4).keepAlive)
|
|
6140
6018
|
};
|
|
6141
6019
|
};
|
|
6142
|
-
_RemoveKeepAlive2 = new WeakSet();
|
|
6143
6020
|
RemoveKeepAlive_fn2 = function(subscription) {
|
|
6144
6021
|
if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
|
|
6145
|
-
__privateMethod(this,
|
|
6022
|
+
__privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
|
|
6146
6023
|
clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
|
|
6147
6024
|
delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
|
|
6148
6025
|
}
|
|
6149
6026
|
};
|
|
6150
6027
|
class ObservabilitySubscriptionManager {
|
|
6151
6028
|
constructor(options) {
|
|
6152
|
-
__privateAdd(this,
|
|
6153
|
-
__privateAdd(this, _LogErrorMessage3);
|
|
6029
|
+
__privateAdd(this, _ObservabilitySubscriptionManager_instances);
|
|
6154
6030
|
__privateAdd(this, _observabilitySocketIOSubscriber, null);
|
|
6155
6031
|
__privateAdd(this, _subscriptions, []);
|
|
6156
|
-
__privateAdd(this, _kafkaHelper
|
|
6032
|
+
__privateAdd(this, _kafkaHelper);
|
|
6157
6033
|
__privateAdd(this, _serviceModel, {});
|
|
6158
6034
|
__privateAdd(this, _agentModel, {});
|
|
6159
6035
|
__privateAdd(this, _lambdaModel, {});
|
|
6160
|
-
__privateAdd(this, _options5
|
|
6036
|
+
__privateAdd(this, _options5);
|
|
6161
6037
|
__privateSet(this, _options5, options);
|
|
6162
6038
|
__privateSet(this, _kafkaHelper, new KafkaHelper({
|
|
6163
6039
|
maxLogLength: __privateGet(this, _options5).maxLogLength
|
|
@@ -6190,7 +6066,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6190
6066
|
subscriptions.map((subscription) => {
|
|
6191
6067
|
const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
|
|
6192
6068
|
if (retVal) {
|
|
6193
|
-
__privateMethod(this,
|
|
6069
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
|
|
6194
6070
|
} else {
|
|
6195
6071
|
subscriptionsToAdd.push(subscription);
|
|
6196
6072
|
}
|
|
@@ -6199,7 +6075,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6199
6075
|
subscriptionsToAdd.map((s) => this.subscriptions.push(s));
|
|
6200
6076
|
(_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
|
|
6201
6077
|
} else {
|
|
6202
|
-
__privateMethod(this,
|
|
6078
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
|
|
6203
6079
|
}
|
|
6204
6080
|
}
|
|
6205
6081
|
RemoveSubscriptionsByKey(keyToFind) {
|
|
@@ -6294,11 +6170,11 @@ class ObservabilitySubscriptionManager {
|
|
|
6294
6170
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
|
|
6295
6171
|
__privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6296
6172
|
if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
|
|
6297
|
-
__privateMethod(this,
|
|
6173
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
|
|
6298
6174
|
}
|
|
6299
6175
|
}
|
|
6300
6176
|
} catch (error) {
|
|
6301
|
-
__privateMethod(this,
|
|
6177
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, error);
|
|
6302
6178
|
return;
|
|
6303
6179
|
}
|
|
6304
6180
|
}
|
|
@@ -6309,7 +6185,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6309
6185
|
for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6310
6186
|
__privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6311
6187
|
if (__privateGet(this, _serviceModel)[serviceId] === null) {
|
|
6312
|
-
__privateMethod(this,
|
|
6188
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServices():Error: GetModelForService() returned null`));
|
|
6313
6189
|
}
|
|
6314
6190
|
}
|
|
6315
6191
|
} catch (error) {
|
|
@@ -6343,7 +6219,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6343
6219
|
}
|
|
6344
6220
|
}
|
|
6345
6221
|
} else {
|
|
6346
|
-
__privateMethod(this,
|
|
6222
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
|
|
6347
6223
|
}
|
|
6348
6224
|
} else {
|
|
6349
6225
|
if (subscribeToKafka) {
|
|
@@ -6386,7 +6262,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6386
6262
|
}
|
|
6387
6263
|
}
|
|
6388
6264
|
} else {
|
|
6389
|
-
__privateMethod(this,
|
|
6265
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
|
|
6390
6266
|
}
|
|
6391
6267
|
} else {
|
|
6392
6268
|
if (subscribeToKafka) {
|
|
@@ -6411,12 +6287,12 @@ class ObservabilitySubscriptionManager {
|
|
|
6411
6287
|
if (Object.keys(subscriptionPayload.data).length !== 0) {
|
|
6412
6288
|
__privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6413
6289
|
if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
|
|
6414
|
-
__privateMethod(this,
|
|
6290
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
|
|
6415
6291
|
}
|
|
6416
6292
|
}
|
|
6417
6293
|
}
|
|
6418
6294
|
} catch (error) {
|
|
6419
|
-
__privateMethod(this,
|
|
6295
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, error);
|
|
6420
6296
|
return;
|
|
6421
6297
|
}
|
|
6422
6298
|
}
|
|
@@ -6445,7 +6321,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6445
6321
|
}
|
|
6446
6322
|
}
|
|
6447
6323
|
} else {
|
|
6448
|
-
__privateMethod(this,
|
|
6324
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
|
|
6449
6325
|
}
|
|
6450
6326
|
} else {
|
|
6451
6327
|
if (subscribeToKafka) {
|
|
@@ -6456,7 +6332,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6456
6332
|
}
|
|
6457
6333
|
}
|
|
6458
6334
|
} catch (error) {
|
|
6459
|
-
__privateMethod(this,
|
|
6335
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
|
|
6460
6336
|
}
|
|
6461
6337
|
}
|
|
6462
6338
|
// /agentId/agentWorkerId
|
|
@@ -6489,7 +6365,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6489
6365
|
}
|
|
6490
6366
|
}
|
|
6491
6367
|
} else {
|
|
6492
|
-
__privateMethod(this,
|
|
6368
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
|
|
6493
6369
|
}
|
|
6494
6370
|
} else {
|
|
6495
6371
|
if (subscribeToKafka) {
|
|
@@ -6501,7 +6377,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6501
6377
|
}
|
|
6502
6378
|
}
|
|
6503
6379
|
} catch (error) {
|
|
6504
|
-
__privateMethod(this,
|
|
6380
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
|
|
6505
6381
|
}
|
|
6506
6382
|
}
|
|
6507
6383
|
// /agentId/agentWorkerId/asyncRunnerId
|
|
@@ -6531,7 +6407,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6531
6407
|
}
|
|
6532
6408
|
}
|
|
6533
6409
|
} else {
|
|
6534
|
-
__privateMethod(this,
|
|
6410
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
|
|
6535
6411
|
}
|
|
6536
6412
|
} else {
|
|
6537
6413
|
if (subscribeToKafka) {
|
|
@@ -6544,7 +6420,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6544
6420
|
}
|
|
6545
6421
|
}
|
|
6546
6422
|
} catch (error) {
|
|
6547
|
-
__privateMethod(this,
|
|
6423
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
|
|
6548
6424
|
}
|
|
6549
6425
|
}
|
|
6550
6426
|
// --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
|
|
@@ -6555,11 +6431,11 @@ class ObservabilitySubscriptionManager {
|
|
|
6555
6431
|
if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
|
|
6556
6432
|
__privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6557
6433
|
if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
|
|
6558
|
-
__privateMethod(this,
|
|
6434
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
|
|
6559
6435
|
}
|
|
6560
6436
|
}
|
|
6561
6437
|
} catch (error) {
|
|
6562
|
-
__privateMethod(this,
|
|
6438
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, error);
|
|
6563
6439
|
return;
|
|
6564
6440
|
}
|
|
6565
6441
|
}
|
|
@@ -6570,7 +6446,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6570
6446
|
for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
|
|
6571
6447
|
__privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
|
|
6572
6448
|
if (__privateGet(this, _lambdaModel)[technologyId] === null) {
|
|
6573
|
-
__privateMethod(this,
|
|
6449
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
|
|
6574
6450
|
}
|
|
6575
6451
|
}
|
|
6576
6452
|
} catch (error) {
|
|
@@ -6604,7 +6480,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6604
6480
|
}
|
|
6605
6481
|
}
|
|
6606
6482
|
} else {
|
|
6607
|
-
__privateMethod(this,
|
|
6483
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
|
|
6608
6484
|
}
|
|
6609
6485
|
} else {
|
|
6610
6486
|
if (subscribeToKafka) {
|
|
@@ -6647,7 +6523,7 @@ class ObservabilitySubscriptionManager {
|
|
|
6647
6523
|
}
|
|
6648
6524
|
}
|
|
6649
6525
|
} else {
|
|
6650
|
-
__privateMethod(this,
|
|
6526
|
+
__privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
|
|
6651
6527
|
}
|
|
6652
6528
|
} else {
|
|
6653
6529
|
if (subscribeToKafka) {
|
|
@@ -6671,22 +6547,17 @@ _serviceModel = new WeakMap();
|
|
|
6671
6547
|
_agentModel = new WeakMap();
|
|
6672
6548
|
_lambdaModel = new WeakMap();
|
|
6673
6549
|
_options5 = new WeakMap();
|
|
6674
|
-
|
|
6550
|
+
_ObservabilitySubscriptionManager_instances = new WeakSet();
|
|
6675
6551
|
LogDebugMessage_fn4 = function(message) {
|
|
6676
6552
|
__privateGet(this, _options5).logger.debug(message);
|
|
6677
6553
|
};
|
|
6678
|
-
_LogErrorMessage3 = new WeakSet();
|
|
6679
6554
|
LogErrorMessage_fn3 = function(message) {
|
|
6680
6555
|
__privateGet(this, _options5).logger.error(message);
|
|
6681
6556
|
};
|
|
6682
6557
|
class SocketIoClientHelper {
|
|
6683
6558
|
constructor(options) {
|
|
6684
|
-
|
|
6685
|
-
__privateAdd(this,
|
|
6686
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6687
|
-
__privateAdd(this, _LogErrorMessage4);
|
|
6688
|
-
__privateAdd(this, _EstablishSocketConnect);
|
|
6689
|
-
__privateAdd(this, _options6, void 0);
|
|
6559
|
+
__privateAdd(this, _SocketIoClientHelper_instances);
|
|
6560
|
+
__privateAdd(this, _options6);
|
|
6690
6561
|
__privateAdd(this, _sockets, {});
|
|
6691
6562
|
__privateAdd(this, _httpsAgent2, null);
|
|
6692
6563
|
__privateSet(this, _options6, options);
|
|
@@ -6713,7 +6584,7 @@ class SocketIoClientHelper {
|
|
|
6713
6584
|
socket: null,
|
|
6714
6585
|
errorCallBack
|
|
6715
6586
|
};
|
|
6716
|
-
__privateMethod(this,
|
|
6587
|
+
__privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack);
|
|
6717
6588
|
return this.sockets[name].socket;
|
|
6718
6589
|
}
|
|
6719
6590
|
GetSocket(name) {
|
|
@@ -6726,17 +6597,15 @@ class SocketIoClientHelper {
|
|
|
6726
6597
|
_options6 = new WeakMap();
|
|
6727
6598
|
_sockets = new WeakMap();
|
|
6728
6599
|
_httpsAgent2 = new WeakMap();
|
|
6729
|
-
|
|
6600
|
+
_SocketIoClientHelper_instances = new WeakSet();
|
|
6601
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6730
6602
|
LogDebugMessage_fn5 = function(message) {
|
|
6731
|
-
if (__privateGet(this, _options6).logger)
|
|
6732
|
-
__privateGet(this, _options6).logger.debug(message);
|
|
6603
|
+
if (__privateGet(this, _options6).logger) __privateGet(this, _options6).logger.debug(message);
|
|
6733
6604
|
};
|
|
6734
|
-
|
|
6605
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6735
6606
|
LogErrorMessage_fn4 = function(message) {
|
|
6736
|
-
if (__privateGet(this, _options6).logger)
|
|
6737
|
-
__privateGet(this, _options6).logger.error(message);
|
|
6607
|
+
if (__privateGet(this, _options6).logger) __privateGet(this, _options6).logger.error(message);
|
|
6738
6608
|
};
|
|
6739
|
-
_EstablishSocketConnect = new WeakSet();
|
|
6740
6609
|
EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBack) {
|
|
6741
6610
|
const socketDetail = this.sockets[name];
|
|
6742
6611
|
if (socketDetail.socket !== null) {
|
|
@@ -6745,9 +6614,9 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
|
|
|
6745
6614
|
}
|
|
6746
6615
|
socketDetail.socket = null;
|
|
6747
6616
|
if (isNode) {
|
|
6748
|
-
setTimeout(() => __privateMethod(this,
|
|
6617
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6749
6618
|
} else {
|
|
6750
|
-
setTimeout(() => __privateMethod(this,
|
|
6619
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6751
6620
|
}
|
|
6752
6621
|
return;
|
|
6753
6622
|
}
|
|
@@ -6767,7 +6636,7 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
|
|
|
6767
6636
|
socketDetail.socket = io(socketDetail.address, socketOptions);
|
|
6768
6637
|
socketDetail.socket.on("connect", () => {
|
|
6769
6638
|
if (socketDetail.socket) {
|
|
6770
|
-
__privateMethod(this,
|
|
6639
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, `Socket: [${socketDetail.socket.id}]: connected`);
|
|
6771
6640
|
if (onConnectCallBack) {
|
|
6772
6641
|
setTimeout(() => {
|
|
6773
6642
|
onConnectCallBack(socketDetail.socket);
|
|
@@ -6778,45 +6647,45 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
|
|
|
6778
6647
|
}
|
|
6779
6648
|
} else {
|
|
6780
6649
|
const errorMessage = "Could not get socket object from socket.io";
|
|
6781
|
-
__privateMethod(this,
|
|
6650
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogErrorMessage_fn4).call(this, errorMessage);
|
|
6782
6651
|
socketDetail.errorCallBack(new Error(errorMessage));
|
|
6783
6652
|
}
|
|
6784
6653
|
});
|
|
6785
6654
|
socketDetail.socket.on("disconnect", (reason) => {
|
|
6786
|
-
__privateMethod(this,
|
|
6655
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "socket disconnect: " + reason);
|
|
6787
6656
|
switch (reason) {
|
|
6788
6657
|
case "io server disconnect":
|
|
6789
6658
|
{
|
|
6790
|
-
__privateMethod(this,
|
|
6791
|
-
__privateMethod(this,
|
|
6659
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
6660
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
|
|
6792
6661
|
const socketDetail2 = this.sockets[name];
|
|
6793
6662
|
socketDetail2.socket = null;
|
|
6794
6663
|
if (isNode) {
|
|
6795
|
-
setTimeout(() => __privateMethod(this,
|
|
6664
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6796
6665
|
} else {
|
|
6797
|
-
setTimeout(() => __privateMethod(this,
|
|
6666
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6798
6667
|
}
|
|
6799
6668
|
}
|
|
6800
6669
|
break;
|
|
6801
6670
|
case "io client disconnect":
|
|
6802
|
-
__privateMethod(this,
|
|
6803
|
-
__privateMethod(this,
|
|
6671
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
|
|
6672
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "The connection will not be re-established automatically.");
|
|
6804
6673
|
break;
|
|
6805
6674
|
case "transport close":
|
|
6806
6675
|
case "ping timeout":
|
|
6807
6676
|
case "transport error":
|
|
6808
6677
|
{
|
|
6809
|
-
__privateMethod(this,
|
|
6810
|
-
__privateMethod(this,
|
|
6678
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
6679
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
|
|
6811
6680
|
const socketDetail2 = this.sockets[name];
|
|
6812
6681
|
if (socketDetail2.socket) {
|
|
6813
6682
|
socketDetail2.socket.disconnect();
|
|
6814
6683
|
}
|
|
6815
6684
|
socketDetail2.socket = null;
|
|
6816
6685
|
if (isNode) {
|
|
6817
|
-
setTimeout(() => __privateMethod(this,
|
|
6686
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
6818
6687
|
} else {
|
|
6819
|
-
setTimeout(() => __privateMethod(this,
|
|
6688
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
|
|
6820
6689
|
}
|
|
6821
6690
|
}
|
|
6822
6691
|
break;
|