Audit the project and secure toolbox data
This commit is contained in:
parent
96af62edf0
commit
e87edda5c7
40 changed files with 2324 additions and 125 deletions
|
|
@ -82,7 +82,7 @@ async function instrument(page, expectedCards) {
|
|||
observer.observe(document, { childList: true, subtree: true });
|
||||
let pendingPaint = false;
|
||||
function checkReady() {
|
||||
if (pendingPaint || !metrics.reads.some((read) => read.transactionMs != null)) return;
|
||||
if (pendingPaint || (count > 0 && !metrics.reads.some((read) => read.transactionMs != null))) return;
|
||||
if (!document.querySelector(".toolbox-page") || document.querySelectorAll(".toolbox-card").length !== count) return;
|
||||
pendingPaint = true;
|
||||
observer.disconnect();
|
||||
|
|
@ -168,7 +168,9 @@ try {
|
|||
const summary = {
|
||||
readyMedianMs: median(samples.map((sample) => sample.readyMs)),
|
||||
readyMaxMs: Math.max(...samples.map((sample) => sample.readyMs)),
|
||||
readMedianMs: median(samples.map((sample) => Math.max(...sample.reads.map((read) => read.startMs + read.transactionMs)) - Math.min(...sample.reads.map((read) => read.startMs)))),
|
||||
readMedianMs: median(samples.map((sample) => sample.reads.length
|
||||
? Math.max(...sample.reads.map((read) => read.startMs + read.transactionMs)) - Math.min(...sample.reads.map((read) => read.startMs))
|
||||
: 0)),
|
||||
heapMedianMiB: median(samples.map((sample) => sample.jsHeapBytes / 1024 ** 2)),
|
||||
longestTaskMs: Math.max(0, ...samples.flatMap((sample) => sample.longTasks.map((task) => task.durationMs)))
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue