tracker
All repositories: gitoria
1.6 KB
// tests/photoqueue.hl — mission 046: the sliced photo queue (people.hl photoQueueStart/Step) must equal the former one-shot photoQueue// (inlined below, verbatim) — same ids, same order. On a store copy (app stopped). TRACKER_PHOTOQ_MARK=1 first marks every 3rd person// (photoCheck) and every 5th (tmdbProfile) so the predicate has both outcomes; TRACKER_SLICE_MS=0 forces many ticks.import { env } from 'hl:proc'import { now } from 'hl:time'import { personsTable } from '../lib/shows.hl'import { peopleView, peopleViewCurrent, needsPhoto, photoQueueStart, photoQueueStep } from '../lib/people.hl'oldQueue = () => {peopleViewCurrent()out = []for (id of peopleView.ids) {let p = personsTable.fetch(id)if (p != null && needsPhoto(&p)) { out.push(id) }}return out}if (env('TRACKER_PHOTOQ_MARK') == '1') {i = 0for (p of personsTable.find(null, null)) {x = pif (i % 3 == 0) { x.photoCheck = 'TMDB has none' } else if (i % 5 == 0) { x.tmdbProfile = '/x.jpg' }personsTable.update(x.id, x)i = i + 1}}t0 = now()a = env('TRACKER_PHOTOQ_NOOLD') == '1' ? [] : oldQueue()t1 = now()c = photoQueueStart()maxTick = 0while (true) {s = now()done = photoQueueStep(&c)d = now() - sif (d > maxTick) { maxTick = d }if (done) { break }}b = c.outconsole.log('new queue built: ' + b.length)same = a.length == b.lengthi = 0while (same && i < a.length) { if (a[i] != b[i]) { same = false } i = i + 1 }console.log('people ' + peopleView.ids.length + ' old=' + a.length + ' (' + (t1 - t0) + ' ms one block) new=' + b.length + ' ticks=' + c.steps + ' skipped=' + c.skipped + ' scanMs=' + c.ms + ' maxTickMs=' + maxTick)console.log(same ? 'SAME ORDER AND IDS' : 'DIFFERENT')
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