Only log downloads_counter if a value is non-zero
@@ -224,6 +224,8 @@ impl PersistStats {
}
pub fn log(&self) {
+ if self.counted_downloads != 0 && self.counted_versions != 0 && self.pending_downloads != 0
+ {
println!(
"downloads_counter shard={} counted_versions={} counted_downloads={} pending_downloads={}",
self.shard.map(|s| s.to_string()).unwrap_or_else(|| "all".into()),
@@ -233,6 +235,7 @@ impl PersistStats {
);
}
}
+}
#[cfg(test)]
mod tests {
