Skip to content

Commit

Permalink
zpool iostat -ow object store latency buckets off by one (openzfs#823)
Browse files Browse the repository at this point in the history
In `zpool iostat -ow`, the `object_store` latencies are being counted in
one higher bucket than they should be (e.g. 512us instead of 256us),
making it hard to compared to the `object_agent` latencies.  The bucket
index is somewhat confusing due to the kernel's definition of
`L_HISTO()`.

This commit fixes the issue.
  • Loading branch information
ahrens authored Apr 27, 2023
1 parent f254ef3 commit 0765234
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/zfs_object_agent/zettaobject/src/access_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl<'a> OpInProgress<'a> {

// This bucket mapping is equivalent to L_HISTO() macro in zfs.h
let latency_bucket = std::cmp::min(
latency.next_power_of_two().trailing_zeros(),
latency.next_power_of_two().trailing_zeros() - 1,
LATENCY_HISTOGRAM_BUCKETS - 1,
) as usize;

Expand Down

0 comments on commit 0765234

Please sign in to comment.