@pisell/core 1.0.66 → 1.0.67
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/es/request/index.js +6 -0
- package/lib/request/index.js +4 -0
- package/package.json +1 -1
package/es/request/index.js
CHANGED
|
@@ -45,6 +45,11 @@ var isFilterUrl = function isFilterUrl(url) {
|
|
|
45
45
|
return url.includes(filterUrl);
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
+
function isObserverIgnoredUrl(url) {
|
|
49
|
+
return ["amazonaws.com", "open.feishu.cn"].some(function (ignoredDomain) {
|
|
50
|
+
return url.includes(ignoredDomain);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
48
53
|
function reportSlowRequestByObserver(entry) {
|
|
49
54
|
var _getConfig2 = getConfig(),
|
|
50
55
|
logger = _getConfig2.logger;
|
|
@@ -58,6 +63,7 @@ function reportSlowRequestByObserver(entry) {
|
|
|
58
63
|
var requestDuration = getSafeDuration(entry.requestStart, entry.responseEnd);
|
|
59
64
|
var tlsHandshakeDuration = entry.secureConnectionStart > 0 ? getSafeDuration(entry.secureConnectionStart, entry.connectEnd) : 0;
|
|
60
65
|
if (!requestUrl) return;
|
|
66
|
+
if (isObserverIgnoredUrl(requestUrl)) return;
|
|
61
67
|
if (isFilterUrl(requestUrl)) return;
|
|
62
68
|
if (entry.duration <= maxRequestTime) return;
|
|
63
69
|
var app = getApp();
|
package/lib/request/index.js
CHANGED
|
@@ -68,6 +68,9 @@ var isFilterUrl = (url) => {
|
|
|
68
68
|
const { logger } = (0, import_config.getConfig)();
|
|
69
69
|
return (_a = logger == null ? void 0 : logger.filterUrls) == null ? void 0 : _a.some((filterUrl) => url.includes(filterUrl));
|
|
70
70
|
};
|
|
71
|
+
function isObserverIgnoredUrl(url) {
|
|
72
|
+
return ["amazonaws.com", "open.feishu.cn"].some((ignoredDomain) => url.includes(ignoredDomain));
|
|
73
|
+
}
|
|
71
74
|
function reportSlowRequestByObserver(entry) {
|
|
72
75
|
const { logger } = (0, import_config.getConfig)();
|
|
73
76
|
const maxRequestTime = 2e3;
|
|
@@ -80,6 +83,7 @@ function reportSlowRequestByObserver(entry) {
|
|
|
80
83
|
const requestDuration = getSafeDuration(entry.requestStart, entry.responseEnd);
|
|
81
84
|
const tlsHandshakeDuration = entry.secureConnectionStart > 0 ? getSafeDuration(entry.secureConnectionStart, entry.connectEnd) : 0;
|
|
82
85
|
if (!requestUrl) return;
|
|
86
|
+
if (isObserverIgnoredUrl(requestUrl)) return;
|
|
83
87
|
if (isFilterUrl(requestUrl)) return;
|
|
84
88
|
if (entry.duration <= maxRequestTime) return;
|
|
85
89
|
const app = (0, import_app.getApp)();
|