Skip to content

fix(indexer): count ledgers advanced in indexer_ledgers_processed_total - #323

Open
jeffrey-graham wants to merge 1 commit into
prism-explorer:mainfrom
jeffrey-graham:fix/count-ledgers-processed-metric-295
Open

jeffrey-graham wants to merge 1 commit into
prism-explorer:mainfrom
jeffrey-graham:fix/count-ledgers-processed-metric-295

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Summary

  • Updates indexer_ledgers_processed_total (metricLedgersProcessed) in indexer/src/index.ts to increment by the number of ledgers the cursor actually advanced (Math.max(0, nextCursor - previousCursor)), rather than once per non-empty transaction page.
  • Adds a separate indexer_pages_processed_total (metricPagesProcessed) counter for non-empty transaction pages.
  • Adds unit tests in indexer/src/index.test.ts verifying that advancing the cursor from 100 to 140 records 40 ledgers processed, and that a single ledger split across three pages increments indexer_ledgers_processed_total once and indexer_pages_processed_total three times.

Verification

  • Ran npx tsc --noEmit, npm run lint, npm test, and npm run build in indexer/.

Closes #295

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@jeff-graham-ai is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

Count ledgers, not pages, in indexer_ledgers_processed_total

2 participants