tracker
All repositories: gitoria
2.8 KB
// 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// prepare's stats and, with TRACKER_DUMP_MERGE=1, the stores AFTER every merge step ran, (3) the collections queue, (4) every table's// 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// output through the former `…Queue()` / `mergePrepare()` functions), `sort` both outputs, diff: equal = same jobs, same writes.// Order differs on purpose (slices = key order, the old scans = file order), hence the sort. Run while the app is STOPPED.// TRACKER_STORAGE=<store copy> TRACKER_DUMP_MERGE=1 ./bin/hybriel tests/jobs-dump.hl | sort > out-new.txtimport { env } from 'hl:proc'import { showsTable, seasonsTable, episodesTable, personsTable } from '../lib/shows.hl'import { followsTable } from '../lib/follows.hl'import { watchesTable } from '../lib/watches.hl'import { collectStep, collected } from '../lib/slices.hl'import { adultBackfillScan, adultPred, kindBackfillScan, kindPred, tvmazeStatusScan, statusPred, artScan, artPred } from '../lib/backfill.hl'import { creditsScanStart, creditsPred } from '../lib/credits.hl'import { detailsRepairScan, repairClass } from '../lib/details.hl'import { mergePrepare, mergeStep, mergeStats, mergeLine, persistMerge } from '../lib/merge.hl'import { seedPrepare, seedQueue } from '../lib/collections.hl'printIds = (tag, ids) => {for (id of ids) { console.log(tag + ' ' + id) }console.log('count ' + tag + ' ' + ids.length)return true}drainScan = (c, pred) => {while (!collectStep(&c, pred)) {}return collected(&c)}printIds('adult', drainScan(adultBackfillScan(), adultPred))printIds('kind', drainScan(kindBackfillScan(), kindPred))printIds('status', drainScan(tvmazeStatusScan(), statusPred))printIds('art', drainScan(artScan(), artPred))printIds('credits', drainScan(creditsScanStart(), creditsPred))rq = drainScan(detailsRepairScan(), repairClass)printIds('repair', rq)// the repair queue is "the reduced ones first, then the rest": print the position class toowhile (!mergePrepare()) {}st = mergeStats()console.log('mergeprep groups=' + st.groups + ' records=' + st.records + ' strayTitles=' + st.strayTitles + ' doubleSeasons=' + st.doubleSeasons)while (!seedPrepare()) {}printIds('seed', seedQueue)if (env('TRACKER_DUMP_MERGE') == '1') {let guard = 0while (guard < 100000) { r = mergeStep() if (r.done) { break } guard = guard + 1 }persistMerge()console.log('merge ' + mergeLine())}dumpTable = (tag, table) => {for (r of table.find(null, null)) { console.log('row ' + tag + ' ' + JSON.stringify(r)) }return true}dumpTable('shows', showsTable)dumpTable('seasons', seasonsTable)dumpTable('episodes', episodesTable)dumpTable('persons', personsTable)dumpTable('follows', followsTable)dumpTable('watches', watchesTable)
Branches
Latest commits
- 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
- 0b86324aMerge branch 'records-dp73' into mainTracker
- 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
- 613ae0ecMerge branch 'bs3' into mainTracker
- 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
- 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
- 310613f1Merge branch 'records-dp72' into mainTracker
- 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
- c41587d2Merge branch 'bs2' into mainTracker
- 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
- 019d5cedMerge branch 'records-1110' into mainTracker
- f88ae8b9|||PR records: day56 toggle live, reviewTracker
- b6b3bb4dMerge branch 'ap56e' into mainTracker
- 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
- 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
- 4b54f6f9Merge branch 'records-audit' into mainTracker
- cab4a3bc|||PR records: branch audit, PR-onlyTracker
- 641e1c4cMerge branch 'records-dp71' into mainTracker
- 85a6e9f5|||PR records: DP71 checked in ChromeTracker
- f5be5f18records: gitoria PR-only planTracker