@pisell/core 1.0.65 → 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 +7 -1
- package/lib/request/index.js +5 -1
- package/package.json +1 -1
package/es/request/index.js
CHANGED
|
@@ -45,10 +45,15 @@ 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;
|
|
51
|
-
var maxRequestTime =
|
|
56
|
+
var maxRequestTime = 2000;
|
|
52
57
|
var requestUrl = entry.name || "";
|
|
53
58
|
var dnsLookupDuration = getSafeDuration(entry.domainLookupStart, entry.domainLookupEnd);
|
|
54
59
|
var tcpHandshakeDuration = getSafeDuration(entry.connectStart, entry.connectEnd);
|
|
@@ -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,9 +68,12 @@ 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
|
-
const maxRequestTime =
|
|
76
|
+
const maxRequestTime = 2e3;
|
|
74
77
|
const requestUrl = entry.name || "";
|
|
75
78
|
const dnsLookupDuration = getSafeDuration(entry.domainLookupStart, entry.domainLookupEnd);
|
|
76
79
|
const tcpHandshakeDuration = getSafeDuration(entry.connectStart, entry.connectEnd);
|
|
@@ -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)();
|