refactor(test): share allocation report discovery filter (#16427)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 18:17:24 +00:00
1 parent d4c100e995
commit bf8a092dde
1 file changed
+6 -13
@@ -75,23 +75,16 @@ const normal = table(
]),
[3, 4, 5],
);
const discovery = data.summary.find(
(item) =>
item.phase === "discovery" &&
item.cache === "cold" &&
item.profile === "default",
);
const isColdDefaultDiscovery = (row) =>
row.phase === "discovery" &&
row.cache === "cold" &&
row.profile === "default";
const discovery = data.summary.find(isColdDefaultDiscovery);
assert.ok(discovery);
const audit = (role) =>
median(
data.records
.filter(
(row) =>
row.phase === "discovery" &&
row.cache === "cold" &&
row.profile === "default" &&
row.role === role,
)
.filter((row) => isColdDefaultDiscovery(row) && row.role === role)
.map(
(row) =>
(row.runtime_audit_ms.before + row.runtime_audit_ms.after) / 1000,