mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
fix(performance): report slack usage only for entries that have slack
A wall-clock measurement above `value` but within `value × toleranceRatio` fell into the slack branch and was reported as using "slack", conflating timing tolerance with counter slack. Only entries with `slack` report it now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0166PWobUjpoiWt8E9bBdsCs
This commit is contained in:
2 files changed
+3
-2
No files matched your search
@@ -188,7 +188,7 @@ export function compareToBaselines({ baselines, summary, only = [] }) {
|
||||
result.failures.push(
|
||||
`${label}: ${formatNumber(measured)}${unit} exceeds ${limitText} by ${formatNumber(measured - limit)}${unit}. Bring the value back down; baselines only move down. If the growth is a deliberate trade-off, raise the baseline in ${DEFAULT_BASELINES_PATH}, make the case in the PR, and ask a maintainer to add the ${BASELINE_INCREASE_LABEL} label.`
|
||||
);
|
||||
} else if (measured > entry.value) {
|
||||
} else if (entry.slack && measured > entry.value) {
|
||||
result.passed.push(
|
||||
`${label}: ${formatNumber(measured)}${unit} within ${limitText}; uses ${formatNumber(measured - entry.value)} of ${formatNumber(limit - entry.value)}${unit} slack.`
|
||||
);
|
||||
|
||||
@@ -155,8 +155,9 @@ test('wall-clock entries fail only above value × toleranceRatio', () => {
|
||||
assert.deepEqual(within.failures, []);
|
||||
assert.match(
|
||||
within.passed[1],
|
||||
/1,250 ms within 1,250 \(baseline 1,000 × 1\.25\)/
|
||||
/1,250 ms within 1,250 \(baseline 1,000 × 1\.25\)\.$/
|
||||
);
|
||||
assert.doesNotMatch(within.passed[1], /slack/);
|
||||
|
||||
const above = compareToBaselines({
|
||||
baselines,
|
||||
|
||||
Reference in new issue
Block a user