src/api2/backup/environment.rs: log duplicate chunks

This commit is contained in:
Dietmar Maurer 2019-06-14 07:12:30 +02:00
parent fa148dbd11
commit 36075475a6
1 changed files with 15 additions and 1 deletions

View File

@ -294,7 +294,21 @@ impl BackupEnvironment {
self.log(format!("Upload statistics for '{}'", archive_name));
self.log(format!("Size: {}", size));
self.log(format!("Chunk count: {}", chunk_count));
if size == 0 || chunk_count == 0 {
return;
}
self.log(format!("Upload size: {} ({}%)", upload_stat.size, (upload_stat.size*100)/size));
let client_side_duplicates = chunk_count - upload_stat.count;
let server_side_duplicates = upload_stat.duplicates;
if (client_side_duplicates + server_side_duplicates) > 0 {
let per = (client_side_duplicates + server_side_duplicates)*100/chunk_count;
self.log(format!("Duplicates: {}+{} ({}%)", client_side_duplicates, server_side_duplicates, per));
}
if upload_stat.size > 0 {
self.log(format!("Compression: {}%", (upload_stat.compressed_size*100)/upload_stat.size));
}