fix: 收敛 WebProbe 物理内存与资源上限
This commit is contained in:
@@ -227,7 +227,7 @@ function compactPerformanceAttribution(item) {
|
||||
}
|
||||
|
||||
async function capturePerformanceProfile(command) {
|
||||
const durationMs = boundedInteger(command.durationMs, 5000, 100, 600000);
|
||||
const durationMs = boundedInteger(command.durationMs, Math.min(5000, maxPerformanceCaptureMs), 100, maxPerformanceCaptureMs);
|
||||
const timeoutMs = Math.max(3000, Math.min(15000, Number(alertThresholds.playwrightResponsivenessRedMs) || 5000));
|
||||
const captureId = safeId(command.label || command.id || ("perf-" + Date.now().toString(36))) || ("perf-" + Date.now().toString(36));
|
||||
const targetPage = page && !page.isClosed() ? page : observerPage && !observerPage.isClosed() ? observerPage : null;
|
||||
@@ -264,7 +264,7 @@ async function capturePerformanceProfile(command) {
|
||||
beforeDrain,
|
||||
valuesRedacted: true,
|
||||
}));
|
||||
await sleep(durationMs);
|
||||
await interruptibleRunnerSleep(durationMs);
|
||||
stopped = await withHardTimeout(session.send("Profiler.stop"), Math.max(timeoutMs, 5000), "Profiler.stop exceeded " + Math.max(timeoutMs, 5000) + "ms");
|
||||
} catch (error) {
|
||||
captureError = error;
|
||||
|
||||
Reference in New Issue
Block a user