Read counter not reported in PageCacheWrapper
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
Description:
The Read counter in bf-tree's internal metrics is only incremented within the BfTree::read() method. However, the PageCacheWrapper in the benchmark/ subdirectory implements its point-read logic using db.scan_with_count(key, 1, ...).
Because this approach bypasses the BfTree::read() method, point-read operations are not tracked in the Read counter, leading to a reported value of "Read": 0 in benchmark JSON results, even when throughput is high.
Proposed Fix:
Manually invoke the counter!(Read) macro within the read() implementation of the PageCacheWrapper to ensure these operations are consistently tracked alongside other engines.
Example Fix:
// benchmark/src/wrappers/page_cache_wrapper.rs
fn read(&self, key: &[u8], value: &mut [u8]) -> usize {
bf_tree::counter!(Read); // Ensure point-reads via scan are recorded
let mut iter = self.db.scan_with_count(key, 1, ScanReturnField::Value)
.expect("Failed to create scan iterator");
// ...
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open benchmark/src/wrappers/page_cache_wrapper.rs and inspect PageCacheWrapper::read(), which performs point reads through scan_with_count. Add the Read counter invocation described in the issue, then run the relevant benchmark and confirm the JSON results report a nonzero Read count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases, performance
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100