src/backup/datastore.rs - garbage-collection: fix average chunk size

This commit is contained in:
Dietmar Maurer 2019-12-10 11:25:29 +01:00
parent d105176f45
commit 73e57f244e
1 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ impl DataStore {
let mut gc_status = GarbageCollectionStatus::default(); let mut gc_status = GarbageCollectionStatus::default();
gc_status.upid = Some(worker.to_string()); gc_status.upid = Some(worker.to_string());
worker.log("Start GC phase1 (mark chunks)"); worker.log("Start GC phase1 (mark used chunks)");
self.mark_used_chunks(&mut gc_status)?; self.mark_used_chunks(&mut gc_status)?;
@ -272,7 +272,7 @@ impl DataStore {
let comp_per = (gc_status.disk_bytes*100)/gc_status.index_data_bytes; let comp_per = (gc_status.disk_bytes*100)/gc_status.index_data_bytes;
worker.log(&format!("Disk bytes: {} ({} %)", gc_status.disk_bytes, comp_per)); worker.log(&format!("Disk bytes: {} ({} %)", gc_status.disk_bytes, comp_per));
worker.log(&format!("Disk chunks: {}", gc_status.disk_chunks)); worker.log(&format!("Disk chunks: {}", gc_status.disk_chunks));
let avg_chunk = gc_status.index_data_bytes/(gc_status.disk_chunks as u64); let avg_chunk = gc_status.disk_bytes/(gc_status.disk_chunks as u64);
worker.log(&format!("Average chunk size: {}", avg_chunk)); worker.log(&format!("Average chunk size: {}", avg_chunk));
*self.last_gc_status.lock().unwrap() = gc_status; *self.last_gc_status.lock().unwrap() = gc_status;