gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit24e401b824e401b8Tracker: TR7 watch cleanmre24e401b8/tests/realdata-018-poll.mjs

1.2 KB

  1. // tests/realdata-018-poll.mjs — tracker#18 real-data check: page latency WHILE the daily run works (hl:web serves one request at
  2. // a time; a sync step blocks it). Polls REAL_PATHS in turn every 0.5 s until the server log (REAL_LOG) says "tmdb sync done",
  3. // then prints n / median / p95 / p99 / max in ms and the 5 slowest.
  4. // REAL_PORT=8750 REAL_LOG=.scratch/w067-delta.log node tests/realdata-018-poll.mjs
  5. import { readFileSync } from 'node:fs';
  6. const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8750}`;
  7. const LOG = process.env.REAL_LOG;
  8. const PATHS = (process.env.REAL_PATHS || '/,/movies,/shows').split(',');
  9. const lat = [];
  10. let i = 0;
  11. while (!readFileSync(LOG, 'utf8').includes('tmdb sync done')) {
  12. const p = PATHS[i++ % PATHS.length], t0 = Date.now();
  13. try { await (await fetch(BASE + p)).text(); } catch {}
  14. lat.push({ p, ms: Date.now() - t0, at: new Date(t0).toISOString().slice(11, 19) });
  15. await new Promise(r => setTimeout(r, 500));
  16. }
  17. const s = lat.map(l => l.ms).sort((a, b) => a - b), q = (f) => s[Math.min(s.length - 1, Math.floor(f * s.length))];
  18. console.log(`n=${s.length} median=${q(0.5)} p95=${q(0.95)} p99=${q(0.99)} max=${s[s.length - 1]} ms`);
  19. console.log('slowest:', JSON.stringify([...lat].sort((a, b) => b.ms - a.ms).slice(0, 5)));

Branches

Latest commits

  • 24e401b8Tracker: TR7 watch cleanmre
  • b0412957Tracker: RV28b handed overmre
  • 456940c8Tracker: RULINGS pathmre
  • b87a8fdcTracker: worldapi-conductor paths backmre
  • 641f3b54Tracker: Apollo answermre
  • 8b3cbddaTracker: status, TR7 fix livemre
  • ec30162aTracker: TR7 fix livemre
  • 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
  • 3e164b63Tracker: status after CL1mre
  • 9d686bb3Tracker: CL1 reviewedmre
  • b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
  • 298785f2Tracker: CL1 startedmre
  • 36b22710Tracker: port slot, CL1 briefmre
  • a401190fTracker: GO for the crash loopmre
  • e195d372Tracker: token pathsmre
  • 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
  • 8dd423f7README: login.js stays by caramboleyo's explicit rulemre
  • d8df1493tracker: standby service on port 45018 and a gap-free hand-over in deploy.sh step 4mre
  • 36dd1686ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • ff9b838etracker: the Ended status pill uses the same red as layouts (pill danger); gate updatedmre