gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit498bf644498bf644log: CB gates startmre498bf644/tests/jobs-dump.hl

2.8 KB

  1. // tests/jobs-dump.hl — CHECK of mission 044 (background jobs in slices): prints, one line each, (1) every job's queue (ids), (2) the merge
  2. // prepare's stats and, with TRACKER_DUMP_MERGE=1, the stores AFTER every merge step ran, (3) the collections queue, (4) every table's
  3. // rows as JSON. Run on the SAME store copy with this tree and with the old tree (tests/jobs-dump-old.hl in the old checkout: the same
  4. // output through the former `…Queue()` / `mergePrepare()` functions), `sort` both outputs, diff: equal = same jobs, same writes.
  5. // Order differs on purpose (slices = key order, the old scans = file order), hence the sort. Run while the app is STOPPED.
  6. // TRACKER_STORAGE=<store copy> TRACKER_DUMP_MERGE=1 ./bin/hybriel tests/jobs-dump.hl | sort > out-new.txt
  7. import { env } from 'hl:proc'
  8. import { showsTable, seasonsTable, episodesTable, personsTable } from '../lib/shows.hl'
  9. import { followsTable } from '../lib/follows.hl'
  10. import { watchesTable } from '../lib/watches.hl'
  11. import { collectStep, collected } from '../lib/slices.hl'
  12. import { adultBackfillScan, adultPred, kindBackfillScan, kindPred, tvmazeStatusScan, statusPred, artScan, artPred } from '../lib/backfill.hl'
  13. import { creditsScanStart, creditsPred } from '../lib/credits.hl'
  14. import { detailsRepairScan, repairClass } from '../lib/details.hl'
  15. import { mergePrepare, mergeStep, mergeStats, mergeLine, persistMerge } from '../lib/merge.hl'
  16. import { seedPrepare, seedQueue } from '../lib/collections.hl'
  17. printIds = (tag, ids) => {
  18. for (id of ids) { console.log(tag + ' ' + id) }
  19. console.log('count ' + tag + ' ' + ids.length)
  20. return true
  21. }
  22. drainScan = (c, pred) => {
  23. while (!collectStep(&c, pred)) {}
  24. return collected(&c)
  25. }
  26. printIds('adult', drainScan(adultBackfillScan(), adultPred))
  27. printIds('kind', drainScan(kindBackfillScan(), kindPred))
  28. printIds('status', drainScan(tvmazeStatusScan(), statusPred))
  29. printIds('art', drainScan(artScan(), artPred))
  30. printIds('credits', drainScan(creditsScanStart(), creditsPred))
  31. rq = drainScan(detailsRepairScan(), repairClass)
  32. printIds('repair', rq)
  33. // the repair queue is "the reduced ones first, then the rest": print the position class too
  34. while (!mergePrepare()) {}
  35. st = mergeStats()
  36. console.log('mergeprep groups=' + st.groups + ' records=' + st.records + ' strayTitles=' + st.strayTitles + ' doubleSeasons=' + st.doubleSeasons)
  37. while (!seedPrepare()) {}
  38. printIds('seed', seedQueue)
  39. if (env('TRACKER_DUMP_MERGE') == '1') {
  40. let guard = 0
  41. while (guard < 100000) { r = mergeStep() if (r.done) { break } guard = guard + 1 }
  42. persistMerge()
  43. console.log('merge ' + mergeLine())
  44. }
  45. dumpTable = (tag, table) => {
  46. for (r of table.find(null, null)) { console.log('row ' + tag + ' ' + JSON.stringify(r)) }
  47. return true
  48. }
  49. dumpTable('shows', showsTable)
  50. dumpTable('seasons', seasonsTable)
  51. dumpTable('episodes', episodesTable)
  52. dumpTable('persons', personsTable)
  53. dumpTable('follows', followsTable)
  54. dumpTable('watches', watchesTable)

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