gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitcb78a1a0cb78a1a0HM65 report missing heap diagnostic package with repromrecb78a1a0/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

  • cb78a1a0HM65 report missing heap diagnostic package with repromre
  • 89606a5cHM65 briefmre
  • 096ce0d4log: DP69 live on day48mre
  • b3d8a80bDP69 brief, RV48 mergedmre
  • ce6d7d32Merge rv48: Hybriel day48mre
  • 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre
  • 0a5412b6RV48 brief, day48 outmre
  • 56665efelog: CB69 mergedmre
  • 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
  • e55b379dKeep shared app title independent of the route import graphmre
  • 9a99659blog: hybriel#334, batch waits for day48mre
  • 85fa6c9blog: CB68 result, CB69 startedmre
  • 2f07c1b7log: DP68 boot gate failed, CB68mre
  • 9652782dlog: HM59 merged, DP68 startedmre
  • 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
  • f7bfe90bMove remaining page builders into their topicsmre
  • 7c3991f9log: day46 from Antonmre
  • ec54fc35Move show page logic into the shows topicmre