Skip to content

Commit 31b8d54

Browse files
committed
emit total bytes loss logs
Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent 3ca5b75 commit 31b8d54

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lading/src/generator/file_gen/model.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::collections::{HashMap, HashSet};
55
use bytes::Bytes;
66
use lading_payload::block;
77
use rand::Rng;
8+
use tracing::info;
89

910
/// Time representation of the model
1011
pub type Tick = u64;
@@ -675,6 +676,7 @@ impl State {
675676

676677
// Garbage collect unlinked files with no open handles, calculating the bytes
677678
// lost from these files.
679+
#[tracing::instrument(skip(self))]
678680
fn gc(&mut self) {
679681
let mut to_remove = Vec::new();
680682
for (&inode, node) in &self.nodes {
@@ -688,6 +690,7 @@ impl State {
688690
if let Some(Node::File { file }) = self.nodes.remove(&inode) {
689691
let lost_bytes = file.bytes_written.saturating_sub(file.bytes_read);
690692
self.lost_bytes += lost_bytes;
693+
info!("TOTAL BYTES LOST: {lost}", lost = self.lost_bytes);
691694
}
692695
}
693696
}

0 commit comments

Comments
 (0)