[Storage] Add contiguous journal and QMDB metrics#3721
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
commonware-mcp | 1f0feae | May 08 2026, 01:49 PM |
Benchmark resultsTip ✅ PASSED: No benchmark exceeded the regression threshold. Benchmark comparison table
Baseline commit(s): |
Deploying monorepo with
|
| Latest commit: |
1f0feae
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a77156fa.monorepo-eu0.pages.dev |
| Branch Preview URL: | https://danlaine-metrics.monorepo-eu0.pages.dev |
Collaborator
|
lgtm except for the stack overflow test issues. |
Collaborator
Author
Should (hopefully!) be fixed now 🤞 |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3721 +/- ##
==========================================
+ Coverage 95.81% 95.83% +0.01%
==========================================
Files 466 468 +2
Lines 185899 186717 +818
Branches 4443 4445 +2
==========================================
+ Hits 178119 178931 +812
- Misses 6356 6360 +4
- Partials 1424 1426 +2
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
roberto-bayardo
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds runtime metrics for storage components and a few small adjacent fixes:
read_many/get_manyreturn before recording. Counters that report items processed (items_read,operations_applied) only advance on success.Reader::read_manyoverride that batches the offsets lookup instead of relying on the trait default loop.Reader::read_manyand public keyless location batch reads now document the strictly-increasing input contract required by the optimized journal implementations.keyless::Keyless::init_from_journalnow takes the runtime context as an additional parameter so it can register metrics; the two keyless callers (fixed.rs,variable.rs) pass the context that already wraps the journal label.No wire or storage formats change.
Metrics Added
Names below are the suffixes registered under each component's runtime label. For example, a journal labeled
fixed_metricsexportsfixed_metrics_size. Counter names get an automatic_totalsuffix when emitted; histogram names get_count/_sum/_bucket.Contiguous Journal Metrics
Shared by fixed-size and variable-size contiguous journals:
size: logical end position.pruning_boundary: oldest readable item position.retained: number of readable items retained.tail_items: items in the section containing the newest retained item.append_calls_total: single-item append calls.append_many_calls_total: append-many calls.read_calls_total: single-item async read calls.read_many_calls_total: non-empty batch read calls.try_read_sync_hits_total: synchronous probes (try_read_sync) that returnedSome.items_read_total: items returned by successful read paths (read,read_many,try_read_sync).sync_calls_total: full-sync calls.append_duration: duration of single-item append calls.append_many_duration: duration of append-many calls.read_duration: duration of single-item read calls.read_many_duration: duration of non-empty batch read calls.sync_duration: duration of full-sync calls.Fixed-size contiguous journals also add:
cache_hits_total: fixed items read synchronously without async storage fallback. This includes items satisfied duringread_manyplus successfultry_read_syncprobes. Single-item asyncreadis not counted.cache_misses_total: fixed items not satisfied synchronously. This includesread_manymisses that require async storage fallback, plustry_read_syncprobes that returnedNone, including pruned or out-of-range probes. Single-item asyncreadis not counted.Variable-size contiguous journals also add:
commit_calls_total: commit calls (durable persist that does not fully sync all indexes).commit_duration: duration of commit calls.Variable-size journals are backed by a data journal and an internal fixed-size offsets journal, which is registered under an
offsetschild label. All*_offsets_*metrics on a variable journal come from the internal fixed-size offsets journal. They include internal offset operations performed by variable-journal read, write, sync, prune, replay, rewind, and recovery paths. They are not the user-facing call counts at the variable layer.QMDB Operation-Log Metrics
Used by
any,immutable, andkeylessQMDB layers where applicable:size: logical operation end.pruning_boundary: oldest retained operation location.retained: number of retained operations.inactivity_floor: application-declared pruning floor location.last_commit: most recent commit operation location.apply_batch_calls_total: apply-batch calls.operations_applied_total: operations written by successful batch applications.commit_calls_total: durable commit calls.sync_calls_total: full-sync calls.prune_calls_total: prune calls.apply_batch_duration: duration of apply-batch calls.commit_duration: duration of commit calls.sync_duration: duration of sync calls.prune_duration: duration of prune calls.Key-based QMDB reads (
any,immutable) add:get_calls_total: single-key get calls.get_many_calls_total: non-empty get-many calls.keys_requested_total: keys requested by attempted reads, whether or not found.get_duration: duration of get calls.get_many_duration: duration of non-empty get-many calls.Location-based QMDB reads (
keyless) add:get_calls_total: single-location get calls.get_many_calls_total: non-empty get-many calls. Input locations must be strictly increasing.locations_requested_total: locations requested by attempted reads, whether or not found.get_duration: duration of get calls.get_many_duration: duration of non-empty get-many calls.Current QMDB Metrics
These count Current-layer calls only. The underlying
anycounters (any_apply_batch_calls_total,any_commit_calls_total, etc.) are bumped when Current delegates to the wrappedany::Db. Current'spruneuses the internalany::Db::prune_loghelper, soany_prune_calls_totalwill stay at0in Current-only deployments even ascurrent_prune_calls_totalincreases.pruned_chunks: number of pruned bitmap chunks.sync_boundary: most recent safe sync boundary location.apply_batch_calls_total: Current-layer apply-batch calls.sync_calls_total: Current-layer sync calls.prune_calls_total: Current-layer prune calls.apply_batch_duration: duration of Current-layer apply-batch calls.sync_duration: duration of Current-layer sync calls.prune_duration: duration of Current-layer prune calls.QMDB Sync Progress Metrics
The sync engine now registers progress gauges under a
syncchild label to avoid collisions with journal metrics:sync_journal_size: current sync journal size.sync_target_end: exclusive target range end, equal to journal size when sync completes.