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
- fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
- b2e2206dlog: #63 livemre
- 5831e0e0log: HM64 donemre
- 4042b923Flatten catalog membership rows into paired slotsmre
- ea8a759elog: #61 #62 live, DP63 and HM64 startedmre
- 40439456Merge hm63-searchtext: tracker#63 packed search textmre
- b7e6b48ePack normalized search text behind numeric offsetsmre
- b35f53e1log: DP62 stale runtime decisionmre
- f9593602log: Apollo deploy rule correctionmre
- 3c95f7f3log: DP62 and HM63 startedmre
- 9c4397c9mission HM63mre
- 8dfe42c8mission DP62mre
- e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
- 8274bcf1log: RV44 done, deploy held for the usage windowmre
- 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
- a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
- 6159a248Merge branch 'hm62-personindex' into rv44mre
- a8923d93log: RV44 startedmre
- cf28cf77mission RV44mre
- 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre