Skip to content

Read counter not reported in PageCacheWrapper #12

@evangelisilva

Description

@evangelisilva

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");
    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions