Skip to content

Commit

Permalink
get_object_impl(): log number of chunks in byte stream (openzfs#469)
Browse files Browse the repository at this point in the history
In ObjectAccess::get_object_impl(), log the number of Bytes instances in
the ByteStream that we receive.

FYI, this seems to average around 8-12KB per chunk.
  • Loading branch information
ahrens authored Sep 29, 2021
1 parent bd1e1e0 commit f73ea1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/zfs_object_agent/zettaobject/src/object_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,13 @@ impl ObjectAccess {
let begin = Instant::now();
let mut v =
Vec::with_capacity(usize::try_from(output.content_length.unwrap_or(0)).unwrap());
let mut count = 0;
match output
.body
.unwrap()
.try_for_each(|b| {
v.extend_from_slice(&b);
count += 1;
future::ready(Ok(()))
})
.await
Expand All @@ -279,9 +281,10 @@ impl ObjectAccess {
}
Ok(_) => {
debug!(
"{}: got {} bytes of data in {}ms",
"{}: got {} bytes of data in {} chunks in {}ms",
msg,
v.len(),
count,
begin.elapsed().as_millis()
);
Ok(v)
Expand Down

0 comments on commit f73ea1b

Please sign in to comment.