gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit498bf644498bf644log: CB gates startmre498bf644/tests/realdata-018.mjs

2.1 KB

  1. // tests/realdata-018.mjs — tracker.worldapi.org#18, NOT the gate: titles the daily delta run refreshed, on a COPY of live storage/
  2. // (STATUS.md "ticket #18"). Per title in REAL_TITLES and width (390, 1280): full page load, the header as shown (title, tagline,
  3. // summary start), a screenshot to $REAL_OUT.
  4. // Env: REAL_PORT (8750), REAL_CHROME (8757-8759), REAL_OUT (/tmp/w067/real), REAL_TITLES ('Star-Wars-Andor,Breaking-Bad').
  5. import { writeFileSync, mkdirSync } from 'node:fs';
  6. import { launchBrowser } from './cdp.mjs';
  7. process.env.HL_CHROME ||= '/opt/google/chrome/chrome';
  8. const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8750}`, OUT = process.env.REAL_OUT || '/tmp/w067/real';
  9. mkdirSync(OUT, { recursive: true });
  10. const [CH_FROM, CH_TO] = (process.env.REAL_CHROME || '8757-8759').split('-').map(Number);
  11. const TITLES = (process.env.REAL_TITLES || 'Star-Wars-Andor,Breaking-Bad').split(',').filter(Boolean);
  12. const browser = await launchBrowser({ debugPortRange: [CH_FROM, CH_TO || CH_FROM] });
  13. const page = await browser.newPage();
  14. const ev = (e) => page.evaluate(e);
  15. const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 30000, label: 'hydrated' });
  16. for (const slug of TITLES) {
  17. for (const w of [390, 1280]) {
  18. const mobile = w < 600;
  19. await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: mobile ? 844 : 900, deviceScaleFactor: mobile ? 2 : 1, mobile });
  20. const t0 = Date.now();
  21. await page.goto(BASE + '/shows/' + slug); await hydrated();
  22. const load = Date.now() - t0;
  23. const head = await ev(`JSON.stringify({ h1: (document.querySelector('show-header h1') || {}).textContent || null, summary: ((document.querySelector('show-summary') || {}).textContent || '').slice(0, 120), scrollW: document.documentElement.scrollWidth })`);
  24. writeFileSync(`${OUT}/${slug}-${w}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));
  25. console.log(`${slug} @${w}: full load ${load} ms ${head}`);
  26. }
  27. }
  28. console.log('problems', JSON.stringify(page.problems()));
  29. await browser.close();

Branches

Latest commits

  • 498bf644log: CB gates startmre
  • 6ea2c6d6log: morning re-measure 11-04mre
  • 446290f0log: GC1 livemre
  • 8e6aa91dlog: GC1 deploy retrymre
  • 87ad2dc1log: GC1 deployingmre
  • 53f10fb8Merge branch 'gc1-deploy'mre
  • 7fcbf1d2log: GC1 deploy GOmre
  • 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
  • 6576c1cdgc1: release the people-view scan lists once the view is builtmre
  • 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
  • a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
  • cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
  • 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
  • ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
  • da60547fstatus: GC1 done, backup bugmre
  • e4171021log: GC1 result, backup hard-link bugmre
  • f1597214deploy.sh backup: tar --hard-dereference (hot tar stored mpackdb sidecars as hard links to .sessions files)mre
  • 6b58571elog: GC windowmre
  • 5c8baa1fdeploy lock: hold only around deploy.shmre
  • b8dac822log: hybriel#309mre