log buf.len()

This commit is contained in:
Igor Katson 2024-05-01 21:17:05 +01:00
parent 6cc7fa7ae0
commit fdc9243a41

View file

@ -46,23 +46,27 @@ macro_rules! timeit {
impl TorrentStorage for TimingStorage { impl TorrentStorage for TimingStorage {
fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> { fn pread_exact(&self, file_id: usize, offset: u64, buf: &mut [u8]) -> anyhow::Result<()> {
let storage = &self.name; let storage = &self.name;
let len = buf.len();
timeit!( timeit!(
"pread_exact", "pread_exact",
self.underlying.pread_exact(file_id, offset, buf), self.underlying.pread_exact(file_id, offset, buf),
file_id, file_id,
offset, offset,
storage storage,
len
) )
} }
fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> { fn pwrite_all(&self, file_id: usize, offset: u64, buf: &[u8]) -> anyhow::Result<()> {
let storage = &self.name; let storage = &self.name;
let len = buf.len();
timeit!( timeit!(
"pwrite_all", "pwrite_all",
self.underlying.pwrite_all(file_id, offset, buf), self.underlying.pwrite_all(file_id, offset, buf),
file_id, file_id,
offset, offset,
storage storage,
len
) )
} }