@microsoft/sp-diagnostics 1.23.2 → 1.24.0-beta.3
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/78359e4b-07c2-43c6-8d0b-d060b4d577e8.manifest.json +6 -11
- package/dist/index-internal-beta.d.ts +22 -0
- package/dist/index-internal-public.d.ts +22 -0
- package/dist/index-internal.d.ts +22 -0
- package/dist/sp-diagnostics_none_ebdbca9bc199b51d4466.js +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Api/Engagement/EngagementLogger.js +91 -96
- package/lib-commonjs/Api/Engagement/IEngagementHandler.js +9 -3
- package/lib-commonjs/Api/ExecutionQueue.js +73 -86
- package/lib-commonjs/Api/ILogData.js +6 -3
- package/lib-commonjs/Api/ILogEntry.js +5 -2
- package/lib-commonjs/Api/ILogErrorData.js +6 -3
- package/lib-commonjs/Api/ILogSource.js +10 -3
- package/lib-commonjs/Api/ILogVerboseData.js +6 -3
- package/lib-commonjs/Api/Log/LogHandler.js +27 -26
- package/lib-commonjs/Api/LogEntry.js +40 -39
- package/lib-commonjs/Api/LogFeature.js +14 -10
- package/lib-commonjs/Api/LogLevel.js +22 -19
- package/lib-commonjs/Api/LogManager/CircularBuffer.js +56 -64
- package/lib-commonjs/Api/LogManager/LogManager.js +61 -78
- package/lib-commonjs/Api/LogSource.js +37 -35
- package/lib-commonjs/Api/LogType.js +20 -15
- package/lib-commonjs/Api/Qos/AutoAlertableQosMonitor.js +68 -82
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +5 -2
- package/lib-commonjs/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +5 -2
- package/lib-commonjs/Api/Qos/IQos.js +5 -2
- package/lib-commonjs/Api/Qos/IQosEndEvent.js +5 -2
- package/lib-commonjs/Api/Qos/IQosExtraData.js +15 -3
- package/lib-commonjs/Api/Qos/IQosStartEvent.js +9 -3
- package/lib-commonjs/Api/Qos/QosLogger.js +54 -60
- package/lib-commonjs/Api/Qos/QosMonitor.js +163 -209
- package/lib-commonjs/Api/Qos/QosMonitorShareFailureWithCP.js +72 -92
- package/lib-commonjs/Api/Qos/QosResultType.js +14 -7
- package/lib-commonjs/Api/Trace/DefaultTraceHandler.js +20 -22
- package/lib-commonjs/Api/Trace/ITraceHandler.js +9 -3
- package/lib-commonjs/Api/Trace/ITraceLogger.js +5 -2
- package/lib-commonjs/Api/Trace/LogEvent.js +86 -125
- package/lib-commonjs/Api/Trace/TraceLogger.js +149 -161
- package/lib-commonjs/Diagnostics.js +68 -72
- package/lib-commonjs/DiagnosticsSettingsManager.js +48 -43
- package/lib-commonjs/IDiagnosticsSettings.js +5 -2
- package/lib-commonjs/common/Killswitches.js +13 -9
- package/lib-commonjs/extraData/DisplayApp.js +13 -5
- package/lib-commonjs/extraData/IDiagnosticContextInfo.js +5 -2
- package/lib-commonjs/extraData/IPageExtraData.js +5 -2
- package/lib-commonjs/extraData/PageType.js +15 -8
- package/lib-commonjs/extraData/PromotedState.js +18 -13
- package/lib-commonjs/extraData/WebTemplateId.js +13 -5
- package/lib-commonjs/extraData/setPageExtraData.js +37 -37
- package/lib-commonjs/index.js +102 -50
- package/{lib → lib-dts}/Api/Engagement/IEngagementHandler.d.ts +2 -0
- package/{lib → lib-dts}/Diagnostics.d.ts +11 -0
- package/{lib → lib-dts}/DiagnosticsSettingsManager.d.ts +4 -0
- package/lib-esm/Api/Engagement/EngagementLogger.js +137 -0
- package/lib-esm/Api/Engagement/IEngagementHandler.js +9 -0
- package/lib-esm/Api/ExecutionQueue.js +114 -0
- package/lib-esm/Api/ILogData.js +4 -0
- package/lib-esm/Api/ILogEntry.js +3 -0
- package/lib-esm/Api/ILogErrorData.js +4 -0
- package/lib-esm/Api/ILogSource.js +8 -0
- package/lib-esm/Api/ILogVerboseData.js +4 -0
- package/lib-esm/Api/Log/LogHandler.js +37 -0
- package/lib-esm/Api/LogEntry.js +44 -0
- package/lib-esm/Api/LogFeature.js +8 -0
- package/lib-esm/Api/LogLevel.js +20 -0
- package/lib-esm/Api/LogManager/CircularBuffer.js +83 -0
- package/lib-esm/Api/LogManager/LogManager.js +103 -0
- package/lib-esm/Api/LogSource.js +32 -0
- package/lib-esm/Api/LogType.js +20 -0
- package/lib-esm/Api/Qos/AutoAlertableQosMonitor.js +74 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +6 -0
- package/lib-esm/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +6 -0
- package/lib-esm/Api/Qos/IQos.js +6 -0
- package/lib-esm/Api/Qos/IQosEndEvent.js +6 -0
- package/lib-esm/Api/Qos/IQosExtraData.js +12 -0
- package/lib-esm/Api/Qos/IQosStartEvent.js +6 -0
- package/lib-esm/Api/Qos/QosLogger.js +64 -0
- package/lib-esm/Api/Qos/QosMonitor.js +258 -0
- package/lib-esm/Api/Qos/QosMonitorShareFailureWithCP.js +89 -0
- package/lib-esm/Api/Qos/QosResultType.js +11 -0
- package/lib-esm/Api/Trace/DefaultTraceHandler.js +23 -0
- package/lib-esm/Api/Trace/ITraceHandler.js +9 -0
- package/lib-esm/Api/Trace/ITraceLogger.js +3 -0
- package/lib-esm/Api/Trace/LogEvent.js +104 -0
- package/lib-esm/Api/Trace/TraceLogger.js +180 -0
- package/lib-esm/Diagnostics.js +78 -0
- package/lib-esm/DiagnosticsSettingsManager.js +65 -0
- package/lib-esm/IDiagnosticsSettings.js +3 -0
- package/{lib → lib-esm}/common/Killswitches.js +3 -4
- package/{lib → lib-esm}/extraData/DisplayApp.js +3 -2
- package/lib-esm/extraData/IDiagnosticContextInfo.js +7 -0
- package/lib-esm/extraData/IPageExtraData.js +3 -0
- package/{lib → lib-esm}/extraData/PageType.js +4 -4
- package/lib-esm/extraData/PromotedState.js +15 -0
- package/{lib → lib-esm}/extraData/WebTemplateId.js +3 -2
- package/{lib → lib-esm}/extraData/setPageExtraData.js +14 -20
- package/{lib → lib-esm}/index.js +3 -3
- package/package.json +33 -6
- package/dist/sp-diagnostics_none_414da724f4073ce8bb98.js +0 -1
- package/lib/Api/Engagement/EngagementLogger.d.ts.map +0 -1
- package/lib/Api/Engagement/EngagementLogger.js +0 -143
- package/lib/Api/Engagement/IEngagementHandler.d.ts.map +0 -1
- package/lib/Api/Engagement/IEngagementHandler.js +0 -2
- package/lib/Api/ExecutionQueue.d.ts.map +0 -1
- package/lib/Api/ExecutionQueue.js +0 -131
- package/lib/Api/ILogData.d.ts.map +0 -1
- package/lib/Api/ILogData.js +0 -3
- package/lib/Api/ILogEntry.d.ts.map +0 -1
- package/lib/Api/ILogEntry.js +0 -2
- package/lib/Api/ILogErrorData.d.ts.map +0 -1
- package/lib/Api/ILogErrorData.js +0 -3
- package/lib/Api/ILogSource.d.ts.map +0 -1
- package/lib/Api/ILogSource.js +0 -3
- package/lib/Api/ILogVerboseData.d.ts.map +0 -1
- package/lib/Api/ILogVerboseData.js +0 -3
- package/lib/Api/Log/LogHandler.d.ts.map +0 -1
- package/lib/Api/Log/LogHandler.js +0 -40
- package/lib/Api/LogEntry.d.ts.map +0 -1
- package/lib/Api/LogEntry.js +0 -51
- package/lib/Api/LogFeature.d.ts.map +0 -1
- package/lib/Api/LogFeature.js +0 -11
- package/lib/Api/LogLevel.d.ts.map +0 -1
- package/lib/Api/LogLevel.js +0 -24
- package/lib/Api/LogManager/CircularBuffer.d.ts.map +0 -1
- package/lib/Api/LogManager/CircularBuffer.js +0 -98
- package/lib/Api/LogManager/LogManager.d.ts.map +0 -1
- package/lib/Api/LogManager/LogManager.js +0 -121
- package/lib/Api/LogSource.d.ts.map +0 -1
- package/lib/Api/LogSource.js +0 -40
- package/lib/Api/LogType.d.ts.map +0 -1
- package/lib/Api/LogType.js +0 -23
- package/lib/Api/Qos/AutoAlertableQosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/AutoAlertableQosMonitor.js +0 -93
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.js +0 -2
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts.map +0 -1
- package/lib/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.js +0 -2
- package/lib/Api/Qos/IQos.d.ts.map +0 -1
- package/lib/Api/Qos/IQos.js +0 -2
- package/lib/Api/Qos/IQosEndEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosEndEvent.js +0 -2
- package/lib/Api/Qos/IQosExtraData.d.ts.map +0 -1
- package/lib/Api/Qos/IQosExtraData.js +0 -2
- package/lib/Api/Qos/IQosStartEvent.d.ts.map +0 -1
- package/lib/Api/Qos/IQosStartEvent.js +0 -2
- package/lib/Api/Qos/QosLogger.d.ts.map +0 -1
- package/lib/Api/Qos/QosLogger.js +0 -74
- package/lib/Api/Qos/QosMonitor.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitor.js +0 -304
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.d.ts.map +0 -1
- package/lib/Api/Qos/QosMonitorShareFailureWithCP.js +0 -114
- package/lib/Api/Qos/QosResultType.d.ts.map +0 -1
- package/lib/Api/Qos/QosResultType.js +0 -11
- package/lib/Api/Trace/DefaultTraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/DefaultTraceHandler.js +0 -30
- package/lib/Api/Trace/ITraceHandler.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceHandler.js +0 -2
- package/lib/Api/Trace/ITraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/ITraceLogger.js +0 -2
- package/lib/Api/Trace/LogEvent.d.ts.map +0 -1
- package/lib/Api/Trace/LogEvent.js +0 -147
- package/lib/Api/Trace/TraceLogger.d.ts.map +0 -1
- package/lib/Api/Trace/TraceLogger.js +0 -196
- package/lib/Diagnostics.d.ts.map +0 -1
- package/lib/Diagnostics.js +0 -82
- package/lib/DiagnosticsSettingsManager.d.ts.map +0 -1
- package/lib/DiagnosticsSettingsManager.js +0 -62
- package/lib/IDiagnosticsSettings.d.ts.map +0 -1
- package/lib/IDiagnosticsSettings.js +0 -2
- package/lib/common/Killswitches.d.ts.map +0 -1
- package/lib/extraData/DisplayApp.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.d.ts.map +0 -1
- package/lib/extraData/IDiagnosticContextInfo.js +0 -2
- package/lib/extraData/IPageExtraData.d.ts.map +0 -1
- package/lib/extraData/IPageExtraData.js +0 -2
- package/lib/extraData/PageType.d.ts.map +0 -1
- package/lib/extraData/PromotedState.d.ts.map +0 -1
- package/lib/extraData/PromotedState.js +0 -17
- package/lib/extraData/WebTemplateId.d.ts.map +0 -1
- package/lib/extraData/setPageExtraData.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- /package/{lib → lib-dts}/Api/Engagement/EngagementLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ExecutionQueue.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogErrorData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/ILogVerboseData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Log/LogHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogEntry.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogFeature.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogLevel.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/CircularBuffer.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogManager/LogManager.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogSource.d.ts +0 -0
- /package/{lib → lib-dts}/Api/LogType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/AutoAlertableQosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/ICustomerPromiseErrorDetails.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/CustomerPromiseInterfaces/IExtraDataForCustomerPromise.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQos.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosEndEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/IQosStartEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitor.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosMonitorShareFailureWithCP.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Qos/QosResultType.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/DefaultTraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceHandler.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/ITraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/LogEvent.d.ts +0 -0
- /package/{lib → lib-dts}/Api/Trace/TraceLogger.d.ts +0 -0
- /package/{lib → lib-dts}/IDiagnosticsSettings.d.ts +0 -0
- /package/{lib → lib-dts}/common/Killswitches.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/DisplayApp.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IDiagnosticContextInfo.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/IPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PageType.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/PromotedState.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/WebTemplateId.d.ts +0 -0
- /package/{lib → lib-dts}/extraData/setPageExtraData.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-esm}/sp-diagnostics.manifest.json +0 -0
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
2
|
* @internal
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* The overall count of how many items have ever been added to the buffer.
|
|
14
|
-
*/
|
|
15
|
-
this._count = 0;
|
|
16
|
-
this._isIterating = false;
|
|
17
|
-
if (size <= 0) {
|
|
18
|
-
throw new Error('Size must be positive');
|
|
19
|
-
}
|
|
20
|
-
this._size = size;
|
|
21
|
-
this._buffer = new Array(size);
|
|
3
|
+
*/ "use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function() {
|
|
10
|
+
return CircularBuffer;
|
|
22
11
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
CircularBuffer.prototype.push = function (item) {
|
|
12
|
+
});
|
|
13
|
+
class CircularBuffer {
|
|
14
|
+
get count() {
|
|
15
|
+
return this._count;
|
|
16
|
+
}
|
|
17
|
+
push(item) {
|
|
31
18
|
this._ensureNotIterating();
|
|
32
19
|
this._head++;
|
|
33
20
|
this._count++;
|
|
@@ -35,66 +22,71 @@ var CircularBuffer = /** @class */ (function () {
|
|
|
35
22
|
this._head = 0;
|
|
36
23
|
}
|
|
37
24
|
this._buffer[this._head] = item;
|
|
38
|
-
}
|
|
39
|
-
|
|
25
|
+
}
|
|
26
|
+
forEach(handle) {
|
|
40
27
|
if (this._count === 0) {
|
|
41
28
|
return;
|
|
42
29
|
}
|
|
43
30
|
this._isIterating = true;
|
|
44
31
|
try {
|
|
45
|
-
|
|
32
|
+
let current = this._tail;
|
|
46
33
|
// For-loop is prefered over while loop here to avoid possible infinite loop.
|
|
47
|
-
for
|
|
34
|
+
for(let i = 0; i < this._size; i++){
|
|
48
35
|
handle(this._buffer[current]);
|
|
49
36
|
if (current === this._head) {
|
|
50
|
-
// The newest item has been processed. End the loop.
|
|
51
37
|
break;
|
|
52
38
|
}
|
|
53
39
|
current = this._getNext(current);
|
|
54
40
|
}
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
41
|
+
} finally{
|
|
57
42
|
this._isIterating = false;
|
|
58
43
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
44
|
+
}
|
|
45
|
+
removeAll() {
|
|
61
46
|
this._ensureNotIterating();
|
|
62
47
|
this._head = -1;
|
|
63
48
|
this._count = 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
enumerable: false,
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
CircularBuffer.prototype._isNotWrapped = function () {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Index of the oldest item in the buffer
|
|
52
|
+
*/ get _tail() {
|
|
53
|
+
if (this._isNotWrapped()) {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
return this._getNext(this._head);
|
|
57
|
+
}
|
|
58
|
+
_isNotWrapped() {
|
|
79
59
|
return this._count === this._head + 1;
|
|
80
|
-
}
|
|
60
|
+
}
|
|
81
61
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var nextIndex = index + 1;
|
|
62
|
+
* The next index should be index + 1, unless it reaches
|
|
63
|
+
* the end of the buffer and needs to rewind to 0.
|
|
64
|
+
*/ _getNext(index) {
|
|
65
|
+
let nextIndex = index + 1;
|
|
87
66
|
if (nextIndex === this._size) {
|
|
88
67
|
nextIndex = 0;
|
|
89
68
|
}
|
|
90
69
|
return nextIndex;
|
|
91
|
-
}
|
|
92
|
-
|
|
70
|
+
}
|
|
71
|
+
_ensureNotIterating() {
|
|
93
72
|
if (this._isIterating) {
|
|
94
73
|
throw new Error('Circular buffer cannot be modified during iteration');
|
|
95
74
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
75
|
+
}
|
|
76
|
+
constructor(size){
|
|
77
|
+
/**
|
|
78
|
+
* Index of the newest item in the buffer
|
|
79
|
+
*/ this._head = -1;
|
|
80
|
+
/**
|
|
81
|
+
* The overall count of how many items have ever been added to the buffer.
|
|
82
|
+
*/ this._count = 0;
|
|
83
|
+
this._isIterating = false;
|
|
84
|
+
if (size <= 0) {
|
|
85
|
+
throw new Error('Size must be positive');
|
|
86
|
+
}
|
|
87
|
+
this._size = size;
|
|
88
|
+
this._buffer = new Array(size);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=./CircularBuffer.js.map
|
|
@@ -1,124 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this._events = new CircularBuffer_1.default(LogManager._maxVerboseLog);
|
|
17
|
-
if (initialHandler) {
|
|
18
|
-
this.addHandler(initialHandler);
|
|
19
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return LogManager;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
+
const _CircularBuffer = /*#__PURE__*/ _interop_require_default._(require("./CircularBuffer"));
|
|
13
|
+
class LogManager {
|
|
14
|
+
static get _maxVerboseLog() {
|
|
15
|
+
return 5000;
|
|
20
16
|
}
|
|
21
|
-
Object.defineProperty(LogManager, "_maxVerboseLog", {
|
|
22
|
-
get: function () {
|
|
23
|
-
return 5000;
|
|
24
|
-
},
|
|
25
|
-
enumerable: false,
|
|
26
|
-
configurable: true
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(LogManager.prototype, "events", {
|
|
29
|
-
/**
|
|
30
|
-
* Event list for delayed asynchronous processing.
|
|
31
|
-
* Events are accumulated in CircularBuffer for processing later.
|
|
32
|
-
*/
|
|
33
|
-
get: function () {
|
|
34
|
-
return this._events;
|
|
35
|
-
},
|
|
36
|
-
enumerable: false,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
17
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
18
|
+
* Event list for delayed asynchronous processing.
|
|
19
|
+
* Events are accumulated in CircularBuffer for processing later.
|
|
20
|
+
*/ get events() {
|
|
21
|
+
return this._events;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Registers an external logger to logger collection for asynchronous event logging.
|
|
25
|
+
* Logger is registered once.
|
|
26
|
+
*/ addHandler(handler) {
|
|
44
27
|
if (!this._containsHandler(handler)) {
|
|
45
28
|
this._handlers.push(handler);
|
|
46
29
|
this._shouldLogInRealTime.push(false);
|
|
47
30
|
}
|
|
48
|
-
}
|
|
31
|
+
}
|
|
49
32
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
LogManager.prototype.log = function (event) {
|
|
33
|
+
* Event logging operation for delayed asynchronous processing.
|
|
34
|
+
*/ log(event) {
|
|
53
35
|
Object.freeze(event);
|
|
54
36
|
this._events.push(event);
|
|
55
37
|
this._processLogEvent(event);
|
|
56
|
-
}
|
|
38
|
+
}
|
|
57
39
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var index = this._handlers.indexOf(handler);
|
|
40
|
+
* Removes an external logger from logger collection for asynchronous event logging.
|
|
41
|
+
* Logger is registered once.
|
|
42
|
+
*/ removeHandler(handler) {
|
|
43
|
+
const index = this._handlers.indexOf(handler);
|
|
63
44
|
if (index > -1) {
|
|
64
45
|
this._handlers.splice(index, 1);
|
|
65
46
|
this._shouldLogInRealTime.splice(index, 1);
|
|
66
47
|
}
|
|
67
|
-
}
|
|
48
|
+
}
|
|
68
49
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
LogManager.prototype.reset = function () {
|
|
50
|
+
* Reset function clears logger collection for asynchronous event logging.
|
|
51
|
+
* All recorded events are purged.
|
|
52
|
+
*/ reset() {
|
|
73
53
|
this._handlers = [];
|
|
74
54
|
this._shouldLogInRealTime = [];
|
|
75
55
|
this._events.removeAll();
|
|
76
|
-
}
|
|
56
|
+
}
|
|
77
57
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
LogManager.prototype.processAll = function (handler) {
|
|
58
|
+
* Processes all the buffered events using the registered handler.
|
|
59
|
+
*/ processAll(handler) {
|
|
81
60
|
if (this._handlers.indexOf(handler) > -1) {
|
|
82
61
|
this._processAllEvents(handler);
|
|
83
62
|
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
for (
|
|
87
|
-
var existingHandler = _a[_i];
|
|
63
|
+
}
|
|
64
|
+
_containsHandler(handler) {
|
|
65
|
+
for (const existingHandler of this._handlers){
|
|
88
66
|
if (existingHandler === handler) {
|
|
89
67
|
return true;
|
|
90
68
|
}
|
|
91
69
|
}
|
|
92
70
|
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
this._events.forEach(
|
|
71
|
+
}
|
|
72
|
+
_processAllEvents(handler) {
|
|
73
|
+
this._events.forEach((event)=>{
|
|
96
74
|
if (event) {
|
|
97
75
|
try {
|
|
98
76
|
handler(event);
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
77
|
+
} catch (e) {
|
|
101
78
|
// eslint-disable-next-line no-console
|
|
102
79
|
console.error('failed to handle event:' + e.toString());
|
|
103
80
|
}
|
|
104
81
|
}
|
|
105
82
|
});
|
|
106
83
|
this._shouldLogInRealTime[this._handlers.indexOf(handler)] = true;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
for
|
|
84
|
+
}
|
|
85
|
+
_processLogEvent(event) {
|
|
86
|
+
for(let i = 0; i < this._handlers.length; i++){
|
|
110
87
|
if (this._shouldLogInRealTime[i] && event) {
|
|
111
88
|
try {
|
|
112
89
|
this._handlers[i](event);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
90
|
+
} catch (e) {
|
|
115
91
|
// eslint-disable-next-line no-console
|
|
116
92
|
console.error('failed to handle event:' + e.toString());
|
|
117
93
|
}
|
|
118
94
|
}
|
|
119
95
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
96
|
+
}
|
|
97
|
+
constructor(initialHandler){
|
|
98
|
+
this._shouldLogInRealTime = [];
|
|
99
|
+
this._handlers = [];
|
|
100
|
+
this._events = new _CircularBuffer.default(LogManager._maxVerboseLog);
|
|
101
|
+
if (initialHandler) {
|
|
102
|
+
this.addHandler(initialHandler);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=./LogManager.js.map
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright (c) Microsoft. All rights reserved.
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
default: function() {
|
|
14
|
+
return LogSource;
|
|
15
|
+
},
|
|
16
|
+
logSourceServiceKey: function() {
|
|
17
|
+
return logSourceServiceKey;
|
|
15
18
|
}
|
|
19
|
+
});
|
|
20
|
+
const _spcorelibrary = require("@microsoft/sp-core-library");
|
|
21
|
+
class LogSource {
|
|
16
22
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
LogSource.create = function (id) {
|
|
23
|
+
* Factory method to create an instance of the LogSource class
|
|
24
|
+
* @returns a reference to an instance of the LogSource class
|
|
25
|
+
*/ static create(id) {
|
|
21
26
|
return new LogSource(id);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
enumerable: false,
|
|
28
|
-
configurable: true
|
|
29
|
-
});
|
|
27
|
+
}
|
|
28
|
+
get id() {
|
|
29
|
+
return this._id;
|
|
30
|
+
}
|
|
30
31
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
LogSource.prototype.isEmpty = function () {
|
|
32
|
+
* @returns if the LogSource is empty.
|
|
33
|
+
*/ isEmpty() {
|
|
34
34
|
return this._id.length === 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
}
|
|
36
|
+
constructor(id){
|
|
37
|
+
_spcorelibrary.Validate.isNotNullOrUndefined(id, 'id');
|
|
38
|
+
this._id = id;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const logSourceServiceKey = _spcorelibrary.ServiceKey.createCustom('sp-client-base:LogSource', (serviceScope)=>{
|
|
41
42
|
return LogSource.create('');
|
|
42
43
|
});
|
|
43
|
-
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=./LogSource.js.map
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright (c) Microsoft. All rights reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
2
|
/**
|
|
5
3
|
* Represents the supported log types
|
|
6
4
|
*
|
|
7
5
|
* @internal
|
|
8
|
-
*/
|
|
6
|
+
*/ "use strict";
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "default", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return _default;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
9
16
|
var LogType;
|
|
10
|
-
(function
|
|
17
|
+
(function(LogType) {
|
|
11
18
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
LogType[LogType["Trace"] = 1] = "Trace";
|
|
19
|
+
* Trace level log. Use this for logging diagnostics
|
|
20
|
+
*/ LogType[LogType["Trace"] = 1] = "Trace";
|
|
15
21
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
LogType[LogType["Event"] = 2] = "Event";
|
|
22
|
+
* Event level log. Use this for logging usage etc
|
|
23
|
+
*/ LogType[LogType["Event"] = 2] = "Event";
|
|
19
24
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
LogType[LogType["Error"] = 3] = "Error";
|
|
25
|
+
* Use for errors
|
|
26
|
+
*/ LogType[LogType["Error"] = 3] = "Error";
|
|
23
27
|
})(LogType || (LogType = {}));
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
const _default = LogType;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=./LogType.js.map
|
|
@@ -1,96 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
AutoAlertableMonitorType: function() {
|
|
13
|
+
return AutoAlertableMonitorType;
|
|
14
|
+
},
|
|
15
|
+
AutoAlertableQosMonitor: function() {
|
|
16
|
+
return AutoAlertableQosMonitor;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _QosMonitor = /*#__PURE__*/ _interop_require_default._(require("./QosMonitor"));
|
|
21
|
+
const AutoAlertableMonitorType = {
|
|
14
22
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
StaticReliabilityQos95Sev4: 'StaticReliabilityQos95Sev4',
|
|
23
|
+
* If QoS drops below a static threshold of 95 for a period, a sev 4 is fired.
|
|
24
|
+
*/ StaticReliabilityQos95Sev4: 'StaticReliabilityQos95Sev4',
|
|
18
25
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
DynamicReliabilityQosMediumSev4: 'DynamicReliabilityQosMediumSev4',
|
|
26
|
+
* If QoS drops below some dynamic threshold "Medium" sensitivity (as defined by Geneva)
|
|
27
|
+
* calculated from historical monitor data, a sev 4 is fired.
|
|
28
|
+
*/ DynamicReliabilityQosMediumSev4: 'DynamicReliabilityQosMediumSev4',
|
|
23
29
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DynamicReliabilityExpectedFailureHighSev4: 'DynamicReliabilityExpectedFailureHighSev4'
|
|
30
|
+
* If the number of expected errors increases past a "High" dynamic threshold sensitivity
|
|
31
|
+
* (as defined by Geneva) calculated from historical monitor data OR QoS drops below some
|
|
32
|
+
* dynamic threshold "Medium" sensitivity, a sev 4 is fired.
|
|
33
|
+
*/ DynamicReliabilityExpectedFailureHighSev4: 'DynamicReliabilityExpectedFailureHighSev4'
|
|
29
34
|
};
|
|
30
|
-
|
|
31
|
-
* Qos logger which enforces using an existing altering monitor as determined by the
|
|
32
|
-
* AlertableMonitorType.
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
var AutoAlertableQosMonitor = /** @class */ (function (_super) {
|
|
37
|
-
tslib_1.__extends(AutoAlertableQosMonitor, _super);
|
|
35
|
+
class AutoAlertableQosMonitor extends _QosMonitor.default {
|
|
38
36
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* @param copyToEngagement - Indicate whether this data should be used as Engagement as well.
|
|
45
|
-
*/
|
|
46
|
-
function AutoAlertableQosMonitor(scenarioName, autoAlertableMonitorType, copyToEngagement) {
|
|
47
|
-
if (copyToEngagement === void 0) { copyToEngagement = false; }
|
|
48
|
-
var _this = _super.call(this, scenarioName, /* copyToCosmos */ false, /* copyToInterana */ copyToEngagement) || this;
|
|
49
|
-
_this._autoAlertableMonitorType = autoAlertableMonitorType;
|
|
50
|
-
return _this;
|
|
37
|
+
* QoS monitor ends with success. Also writes AutoAlertableMonitorType to extraData.
|
|
38
|
+
* You will see success tag: SPPages.ScenarioName.Success
|
|
39
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
writeSuccess(extraData) {
|
|
41
|
+
super.writeSuccess(this._getExtraDataWithAutoAlertableFields(extraData));
|
|
51
42
|
}
|
|
52
43
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
AutoAlertableQosMonitor.prototype.writeSuccess = function (extraData) {
|
|
58
|
-
_super.prototype.writeSuccess.call(this, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* QoS monitor ends with failure. Also writes AutoAlertableMonitorType to extraData.
|
|
62
|
-
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
63
|
-
* <failuretag> will be filled with param tagName
|
|
64
|
-
*/
|
|
65
|
-
AutoAlertableQosMonitor.prototype.writeUnexpectedFailure = function (tagNameSuffix, ex,
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
* QoS monitor ends with failure. Also writes AutoAlertableMonitorType to extraData.
|
|
45
|
+
* You will see failure tag: SPPages.ScenarioName.<failuretag>.Failure.
|
|
46
|
+
* <failuretag> will be filled with param tagName
|
|
47
|
+
*/ writeUnexpectedFailure(tagNameSuffix = 'DefaultUnexpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
48
|
extraData) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
49
|
+
super.writeUnexpectedFailure(tagNameSuffix, ex, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
50
|
+
}
|
|
71
51
|
/*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
AutoAlertableQosMonitor.prototype.writeExpectedFailure = function (tagNameSuffix, ex,
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
* QoS monitor ends with expected failure. Also writes AutoAlertableMonitorType to extraData.
|
|
53
|
+
* You will see success tag: ModernPublish.RenderPublishPage.<failuretag>.ExpectedFailure.
|
|
54
|
+
* <failuretag> will be filled with param tagName
|
|
55
|
+
*/ writeExpectedFailure(tagNameSuffix = 'DefaultExpected', ex, // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
56
|
extraData) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
57
|
+
super.writeExpectedFailure(tagNameSuffix, ex, this._getExtraDataWithAutoAlertableFields(extraData));
|
|
58
|
+
}
|
|
82
59
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
AutoAlertableQosMonitor.prototype._getExtraDataWithAutoAlertableFields = function (extraData) {
|
|
60
|
+
* Gets the extraData with additional auto alertable dimensions to indicate this uses the easy
|
|
61
|
+
* alerting monitors.
|
|
62
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
|
+
_getExtraDataWithAutoAlertableFields(extraData) {
|
|
88
64
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
-
|
|
90
|
-
returnedExtraData.autoAlertableMonitorType =
|
|
65
|
+
const returnedExtraData = extraData ?? {};
|
|
66
|
+
returnedExtraData.autoAlertableMonitorType = AutoAlertableMonitorType[this._autoAlertableMonitorType];
|
|
91
67
|
return returnedExtraData;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a QoS monitor (initializes it and logs the start event) that enforces that end events
|
|
71
|
+
* fired include the alertableMonitorType property in extraData corresponding to the
|
|
72
|
+
*
|
|
73
|
+
* @param scenarioName - Unique name of the QoS scenario
|
|
74
|
+
* @param autoAlertableMonitorType - Correspond to existing alerting monitor that will track the events.
|
|
75
|
+
* @param copyToEngagement - Indicate whether this data should be used as Engagement as well.
|
|
76
|
+
*/ constructor(scenarioName, autoAlertableMonitorType, copyToEngagement = false){
|
|
77
|
+
super(scenarioName, /* copyToCosmos */ false, /* copyToInterana */ copyToEngagement);
|
|
78
|
+
this._autoAlertableMonitorType = autoAlertableMonitorType;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=./AutoAlertableQosMonitor.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=./ICustomerPromiseErrorDetails.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=./IExtraDataForCustomerPromise.js.map
|