From d3ea25a70a93d71b6f00941466faf3e9c691185f Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 26 Jan 2021 22:04:38 +0800 Subject: Show reused percentage of incremental backups. --- .../kbackupfabric/backup/incremental/manager/IncCopyResult.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/keuin/kbackupfabric/backup') diff --git a/src/main/java/com/keuin/kbackupfabric/backup/incremental/manager/IncCopyResult.java b/src/main/java/com/keuin/kbackupfabric/backup/incremental/manager/IncCopyResult.java index 4301adc..6661a27 100644 --- a/src/main/java/com/keuin/kbackupfabric/backup/incremental/manager/IncCopyResult.java +++ b/src/main/java/com/keuin/kbackupfabric/backup/incremental/manager/IncCopyResult.java @@ -95,11 +95,12 @@ public class IncCopyResult { @Override public String toString() { return String.format( - "File(s) added: %d (%s in size, totally %d files). Total backup-ed files size: %s", + "File(s) added: %d (%s in size, totally %d files). Total backup-ed files size: %s (%.2f%% reused)", filesCopied, BackupFilesystemUtil.getFriendlyFileSizeString(bytesCopied), totalFiles, - BackupFilesystemUtil.getFriendlyFileSizeString(bytesTotal) + BackupFilesystemUtil.getFriendlyFileSizeString(bytesTotal), + (1 - 1.0f * bytesCopied / bytesTotal) * 100 ); } } -- cgit v1.2.3