gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite5c9b659e5c9b659Pack retained search IDs into UTF-8 bytesmree5c9b659/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

  • e5c9b659Pack retained search IDs into UTF-8 bytesmre
  • 62a5f6c7HM67 brief, HM66 mergedmre
  • b32b8440Merge hm66-catalogindex: packed catalog indexmre
  • 2db0f7adReport HM66 heap measurements and validationmre
  • 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
  • 71134e21HM66 briefmre
  • ed4cbab2status timemre
  • e982c26dlog: HM65 mergedmre
  • 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
  • 07a5c883HM65 report measured field projection and complete validationmre
  • 0eab858fRead only catalog date fields during the episode boot scanmre
  • d3179273log: HM65 hl:heap vendoringmre
  • 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