Skip to content

Commit

Permalink
Fix benchmark loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fangpenlin committed Jan 9, 2025
1 parent 7a2edd2 commit 2fed93c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/benchmarks/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ impl StorageBenchmark {
.create(true)
.write(true)
.open(&self.path)?;
while true {
while remaining_size > 0 {
let chunk_size = min(self.chunk_size, remaining_size);
let _written = file.write(&buf[..chunk_size])?;
// Notice: somehow there's a bug or what making written size returning 0, which is
// obviously wrong. Before we fix that, we just calculate the remaining_size
// based on the size we have written
remaining_size -= chunk_size;
}
file.sync_all();
file.sync_all()?;
let end = SystemTime::now();
let duration = end.duration_since(start)?;
log::info!(
Expand Down

0 comments on commit 2fed93c

Please sign in to comment.