gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2d4be66f2d4be66fre-vendor Hybriel 5df4eb7e (GC: HL_GC_TABLE_LOAD knob, mission 406)mre2d4be66f/tests/realdata-m026-counts.hl

3.5 KB

  1. // tests/realdata-m026-counts.hl — mission 026 (tracker#31), NOT the gate: the numbers before/after the duplicate merge on a COPY of
  2. // live storage (opening a table rewrites its files — never the live folder; app stopped):
  3. // TRACKER_STORAGE=<copy>/storage/mpackdb ./bin/hybriel tests/realdata-m026-counts.hl
  4. // The creator's (TRACKER_IDENTITY, default az5b2) follows and watches: rows (none is ever deleted) and live ones (show/target set),
  5. // by kind; titles per type+tmdbId held by more than one live record; tombstones; seasons naming a title that does not list them
  6. // (with episodes / with a listed twin = what the merge works on); Reacher's listed season 3 and how many of its episodes the
  7. // creator watched; Archive 81's live records.
  8. import { showsTable, seasonsTable, episodesTable } from '../lib/shows.hl'
  9. import { followsTable } from '../lib/follows.hl'
  10. import { watchesTable } from '../lib/watches.hl'
  11. import { usersTable } from '../lib/users.hl'
  12. import { env } from 'hl:proc'
  13. ident = env('TRACKER_IDENTITY') != null ? env('TRACKER_IDENTITY') : 'az5b2'
  14. let uid = null
  15. for (u of usersTable.find(null, null)) { if (u.identity == ident) { uid = u.id } }
  16. let fRows = 0
  17. let fLive = 0
  18. for (f of followsTable.find(null, null)) { if (f.user == uid) { fRows = fRows + 1 if (f.show != null) { fLive = fLive + 1 } } }
  19. let wRows = 0
  20. let wLive = 0
  21. byType = {}
  22. mine = {}
  23. for (w of watchesTable.find(null, null)) {
  24. if (w.user == uid) {
  25. wRows = wRows + 1
  26. if (w.target != null) {
  27. wLive = wLive + 1
  28. byType[w.targetType] = byType[w.targetType] == null ? 1 : byType[w.targetType] + 1
  29. mine[w.target] = true
  30. }
  31. }
  32. }
  33. console.log('user ' + ident + ' = ' + uid + ': follows rows=' + fRows + ' live=' + fLive + '; watches rows=' + wRows + ' live=' + wLive + ' ' + JSON.stringify(byType))
  34. byKey = {}
  35. let tomb = 0
  36. listedBy = {}
  37. let reacher = null
  38. let archive = 0
  39. for (s of showsTable.find(null, null)) {
  40. if (s.mergedInto != null) { tomb = tomb + 1 } else {
  41. for (x of (s.seasons == null ? [] : s.seasons)) { listedBy[x] = s.id }
  42. if (s.tmdbId != null) {
  43. let k = s.type + ':' + s.tmdbId
  44. byKey[k] = byKey[k] == null ? 1 : byKey[k] + 1
  45. }
  46. if (s.title == 'Reacher' && s.type == 'series') { reacher = s }
  47. if (s.title == 'Archive 81') { archive = archive + 1 }
  48. }
  49. }
  50. let dups = 0
  51. let dupRecords = 0
  52. for (k of byKey.keys()) { if (byKey[k] > 1) { dups = dups + 1 dupRecords = dupRecords + byKey[k] } }
  53. listedNum = {}
  54. all = seasonsTable.find(null, null)
  55. for (x of all) { if (listedBy[x.id] != null) { listedNum[listedBy[x.id] + '#' + x.seasonNumber] = true } }
  56. let stray = 0
  57. let strayWork = 0
  58. let mergedSeasons = 0
  59. for (x of all) {
  60. if (x.mergedInto != null) { mergedSeasons = mergedSeasons + 1 }
  61. else if (x.show != null && listedBy[x.id] == null) {
  62. stray = stray + 1
  63. if ((x.episodes != null && x.episodes.length > 0) || listedNum[x.show + '#' + x.seasonNumber] == true) { strayWork = strayWork + 1 }
  64. }
  65. }
  66. console.log('live type+tmdbId held by more than one record: ' + dups + ' (' + dupRecords + ' records); tombstones: ' + tomb + '; Archive 81 live records: ' + archive)
  67. console.log('stray seasons (naming a live title, not in its list): ' + stray + ', of them with episodes or a listed twin: ' + strayWork + '; merged seasons: ' + mergedSeasons)
  68. if (reacher != null) {
  69. for (sid of reacher.seasons) {
  70. let s = seasonsTable.fetch(sid)
  71. let w = 0
  72. for (e of s.episodes) { if (mine[e] == true) { w = w + 1 } }
  73. console.log('Reacher listed S' + s.seasonNumber + ' ' + s.id + ' (' + s.oldId + '): ' + s.episodes.length + ' episodes, watched by ' + ident + ': ' + w + (mine[s.id] == true ? ', season checked' : ''))
  74. }
  75. }

Branches

Latest commits

  • 2d4be66fre-vendor Hybriel 5df4eb7e (GC: HL_GC_TABLE_LOAD knob, mission 406)mre
  • 99e7c8b9tests: realdata-m035-radii, repro-t38, realdata-060-backfill ports from env (REAL_PORT, REAL_CHROME, REPRO_CHROME), defaults unchangedmre
  • 4625aa22re-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • a6dfd6ecdeploy: person-lookup gate (tracker#46)mre
  • 33ad4bd5Merge commit 'f57f64f'mre
  • 7d38cec4docker-compose: nofile 65536 (default soft 1024 refused boot: errno 24 in fs.listDir, Hybriel 528bc89f)mre
  • f57f64f0mission 046: report, LOGmre
  • 5965963adeploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • efe1b485mission 046: re-vendor Hybriel master 60b2817b (integration 8, #203): plugins mpackdb + web (bin/ git-ignored: hybriel, libhlrt.a, hlc.o, hlrt/ from native/zig-out)mre
  • 53099ffbmission 046: person page reads a slim per-title credit row cache (no whole-record fetch per credit); gate tests/person-lookup.mjsmre
  • 9b3828aemission 046a: report, LOGmre
  • 4b37356emission 046: franchise seed supersedeCollections reads the curated timelines once (10 s one-tick block at the end of boot)mre
  • ac6268e3mission 046a: re-vendor Hybriel 528bc89f (integration 6): plugins mpackdb/time/web (bin/ git-ignored)mre
  • 322b3293mission 046: photoQueue guard for non-row fetch results (damaged persons index)mre
  • e5b99aecmission 046: photoQueue in slices (people.hl photoQueueStart/Step, jobs.hl photoTick), tests/photoqueue.hlmre
  • 31dcf2admission 045: report, LOGmre
  • 9c3971d0tests/persons-skip-count.hlmre
  • 4d72e365mission 045mre
  • b9cae4c9slices: skip and count non-row values from range(); merge persons pass falls back to iterate; guard testmre
  • 3db7dc31merge w44-jobs-slices into w43-trkmemmre