Skip to content

Commit 53b4513

Browse files
committed
display object throughput per second, even though it won't be visible in TUI…
…as the TUI will disappear too quickly.
1 parent 2fbafce commit 53b4513

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

git-odb/src/pack/index/verify.rs

+9
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ impl index::File {
164164

165165
struct Reducer<'a, P> {
166166
progress: &'a std::sync::Mutex<P>,
167+
then: Instant,
167168
entries_seen: u32,
168169
chunks_seen: usize,
169170
stats: PackFileChecksumResult,
@@ -210,6 +211,13 @@ impl index::File {
210211
fn finalize(mut self) -> Result<Self::Output, Self::Error> {
211212
self.progress.lock().unwrap().done("finished");
212213
div_decode_result(&mut self.stats.average, self.chunks_seen);
214+
let elapsed_s = Instant::now().duration_since(self.then).as_secs_f32();
215+
self.progress.lock().unwrap().info(format!(
216+
"Reduced {} objects in {:.2}s ({:.0} objects/s)",
217+
self.entries_seen,
218+
elapsed_s,
219+
self.entries_seen as f32 / elapsed_s
220+
));
213221
Ok(self.stats)
214222
}
215223
}
@@ -312,6 +320,7 @@ impl index::File {
312320
},
313321
Reducer {
314322
progress: &reduce_progress,
323+
then: Instant::now(),
315324
entries_seen: 0,
316325
chunks_seen: 0,
317326
stats: PackFileChecksumResult {

tasks.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* [x] statistics
3131
* [ ] ~~a verbose mode to list each object in a pack, similar to existing git-verify-pack~~
3232
* [x] journey tests
33+
* [x] display object throughput per second
3334
* [ ] support for serde/miniserde for all returned data types (features per crate)
3435
* **stress**
3536
* [ ] first stress test for validation of a big repository, linux maybe, or something smaller but big enough

0 commit comments

Comments
 (0)