mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 21:56:18 -08:00
test(performance): add end-to-end Xtream benchmark harness (#1300)
* docs(performance): plan Xtream benchmark * feat(xtream-mock-server): add deterministic 100k fixture * style(xtream-mock-server): apply repository formatting * fix(xtream-mock-server): harden performance fixture data * feat(xtream-mock-server): add performance control plane * docs(performance): correct Xtream capture plan * fix(xtream-mock-server): harden performance controls * fix(xtream-mock-server): harden control lifecycle * feat(performance): add Xtream preload markers * feat(performance): trace Xtream main phases * feat(performance): mark Xtream store publications * feat(performance): trace Xtream database phases * feat(performance): trace Xtream delete cancellation * feat(performance): capture Xtream phase attribution * feat(performance): mark Sources Xtream refresh * test(performance): define Xtream benchmark evidence contracts * test(performance): add Xtream benchmark runner * test(performance): surface failure evidence writes * test(performance): align database read clock * test(performance): preserve capture failure contracts
This commit is contained in:
1 parent
5e725a06f3
commit
a2fafcfc08
256 files changed
+43760
-883
No files matched your search
@@ -0,0 +1,52 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
import {
|
||||
XTREAM_SCENARIO_ID,
|
||||
type XtreamScenarioId,
|
||||
} from './xtream-benchmark-contract';
|
||||
|
||||
export function xtreamScenarioRequiresSeed(
|
||||
scenarioId: XtreamScenarioId
|
||||
): boolean {
|
||||
return (
|
||||
scenarioId === XTREAM_SCENARIO_ID.REFRESH_LARGE ||
|
||||
scenarioId === XTREAM_SCENARIO_ID.DELETE_LARGE ||
|
||||
scenarioId === XTREAM_SCENARIO_ID.BACKGROUND_UI
|
||||
);
|
||||
}
|
||||
|
||||
export function deriveXtreamMeasuredPlaylistId(
|
||||
requests: readonly { readonly playlistId: string | null }[]
|
||||
): string {
|
||||
const identities = new Set(
|
||||
requests
|
||||
.map(({ playlistId }) => playlistId)
|
||||
.filter(
|
||||
(playlistId): playlistId is string =>
|
||||
typeof playlistId === 'string' && playlistId.length > 0
|
||||
)
|
||||
);
|
||||
const playlistId = identities.values().next().value as string | undefined;
|
||||
if (identities.size !== 1 || !playlistId) {
|
||||
throw new Error('xtream-measured-playlist-identity-invalid');
|
||||
}
|
||||
return playlistId;
|
||||
}
|
||||
|
||||
export async function disableGenericElectronFixtureProbes(
|
||||
page: Page
|
||||
): Promise<void> {
|
||||
await page.evaluate(() => {
|
||||
window.__portalDebugUnsubscribe?.();
|
||||
window.__portalDebugUnsubscribe = undefined;
|
||||
window.__portalDebugEvents = [];
|
||||
window.__dbOperationUnsubscribe?.();
|
||||
window.__dbOperationUnsubscribe = undefined;
|
||||
window.__dbOperationEvents = [];
|
||||
if (window.__rendererFrameRequestId) {
|
||||
window.cancelAnimationFrame(window.__rendererFrameRequestId);
|
||||
}
|
||||
window.__rendererFrameRequestId = undefined;
|
||||
window.__rendererFrameCount = 0;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user