Skip to content

feat: add configurable cache statistics and latency snapshots - #51

Merged
leiysky merged 1 commit into
mainfrom
dev/cache-stats
Sep 16, 2026
Merged

leiysky merged 1 commit into
mainfrom
dev/cache-stats

Conversation

@leiysky

@leiysky leiysky commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add RuntimeOptions::stats and Cache::stats_snapshot() so applications can collect complete request outcomes and cumulative latency distributions independently of the legacy statistics switch. L1 hits, L2 lookups and mutations each support disabled, full or sampled timing. L2 timing starts at L1 miss, allowing full L2 collection without clocks on L1 hits; engine timing covers read/write/reclaim requests from slot reservation through completion.

Recorders use bounded atomic stripes charged to managed memory. Structured snapshots expose timing scope, sampling mode, bucket counts, duration sums and validity; applications own metric conversion and export. Fully specified RuntimeOptions literals need a stats field or a struct-update default. Includes a runnable snapshot example, benchmark controls and regression coverage for accounting, timing boundaries, cancellation and concurrency.

Validation: cargo x check, cargo x test, and cargo x lint passed. The io_uring library also cross-compiles for x86_64-unknown-linux-gnu; Linux runtime execution was not tested locally.

@leiysky
leiysky merged commit 908260e into main Sep 16, 2026
8 checks passed
@leiysky
leiysky deleted the dev/cache-stats branch September 16, 2026 05:15
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.

1 participant