Skip to content

[346] Write polling diagnostics logs for sqlite_vacuum_cleaner - #378

Merged
2 commits merged into
Goldii-locks:mainfrom
ToryMic:fix/346-write-polling-diagnostics-logs-for-sqlite_vacuum_cleaner
Aug 30, 2026
Merged

[346] Write polling diagnostics logs for sqlite_vacuum_cleaner#378
2 commits merged into
Goldii-locks:mainfrom
ToryMic:fix/346-write-polling-diagnostics-logs-for-sqlite_vacuum_cleaner

Conversation

@ToryMic

@ToryMic ToryMic commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Adds high-frequency polling diagnostics logs for sqlite_vacuum_cleaner, mirroring the pattern already used by indexer_runner and indexer_metrics_collector, so operators can spot slow cleanup runs without enabling a profiler.

  • Adds VacuumPollDiagnostics + logVacuumPollDiagnostics(), emitting debug logs whose message string always carries elapsedMs= (plus prunedEvents, retentionDays, and ledger-range context when applicable).
  • Times each pruning step, the VACUUM command (run_vacuum), ledger-range pruning (prune_ledger_range), and the whole runVacuumCleanup cycle with started/success/failure boundaries.
  • Failures keep their existing propagation behavior while still emitting the timing diagnostic.

Validation

  • New sqlite-vacuum-diagnostics.test.ts asserts cleanup stage and boundary diagnostics carry numeric timing values, including failure diagnostics and the all-debug-level log practice.
  • tsc --noEmit, npm test (961 tests), and npm run build all pass.

Also includes small repairs to pre-existing CI failures so this branch is green.

Closes 346
Closes #346

ToryMic added 2 commits August 28, 2026 20:46
- Import jest from @jest/globals in failover-recovery tests that used the
  global (ReferenceError: jest is not defined)
- Drop fake-timer usage that captured the mocked setTimeout and hung
- Type logger.warn/debug spy calls to satisfy strict tsc
- Export SCHEMA_MANAGER_INDEXES from db.ts and import it in the schema
  manager test (ReferenceError)
- Make the Goldii-locks#186 migration-count assertion robust to future migrations
- Accept opts argument in the indexer-runner-historical-sync getEvents mock
…ks#346)

Emit high-frequency polling diagnostics for sqlite_vacuum_cleaner, mirroring
indexer_runner and indexer_metrics_collector so operators can spot slow
cleanup runs without enabling a profiler:
- Add VacuumPollDiagnostics + logVacuumPollDiagnostics() debug logs whose
  messages always carry elapsedMs= (plus prunedEvents/retentionDays/ledger
  range context when applicable).
- Time pruneOldEvents, runVacuum, pruneEventsInLedgerRange, and the whole
  runVacuumCleanup cycle (started/success/failure boundaries).

Add tests asserting the cleanup stages and boundaries emit timing diagnostics
and that failures are reported with elapsed time before propagating.
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@ToryMic Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@godamongstmen897 godamongstmen897 closed this pull request by merging all changes into Goldii-locks:main in 9e42e6f Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write polling diagnostics logs for sqlite_vacuum_cleaner

2 participants