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
- b5357ac4Pack the people order and release completed startup arraysmre
- 2e7d6257log: HM1 startedmre
- 2f790465mission HM1: heap object breakdownmre
- a18957falog: evening re-measure after CBmre
- aac9a98dlog: evening re-measure startmre
- 45163bd4log: person/tmdb error hypothesismre
- cb38de2blog: swap 503 causemre
- fd10c3d5log: CB livemre
- 7557c025log: CB deploy try 2mre
- 06a7534aMerge branch 'cb'mre
- 2f8030d6log: CB gates greenmre
- 498bf644log: CB gates startmre
- f59c2847gc1: bound the five request caches (shows.hl cacheLimit)mre
- 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