Skip to content

Commit b08209e

Browse files
committed
Auto merge of #3558 - jtgeibel:skip-log-empty-download-count, r=pietroalbini
Only log downloads_counter if a value is non-zero This will reduce the logging output on staging and during local development. r? `@pietroalbini`
2 parents 48279c0 + be4f7ae commit b08209e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/downloads_counter.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,16 @@ impl PersistStats {
224224
}
225225

226226
pub fn log(&self) {
227-
println!(
228-
"downloads_counter shard={} counted_versions={} counted_downloads={} pending_downloads={}",
229-
self.shard.map(|s| s.to_string()).unwrap_or_else(|| "all".into()),
230-
self.counted_versions,
231-
self.counted_downloads,
232-
self.pending_downloads,
233-
);
227+
if self.counted_downloads != 0 && self.counted_versions != 0 && self.pending_downloads != 0
228+
{
229+
println!(
230+
"downloads_counter shard={} counted_versions={} counted_downloads={} pending_downloads={}",
231+
self.shard.map(|s| s.to_string()).unwrap_or_else(|| "all".into()),
232+
self.counted_versions,
233+
self.counted_downloads,
234+
self.pending_downloads,
235+
);
236+
}
234237
}
235238
}
236239

0 commit comments

Comments
 (0)