all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Shan Shaji <s.shaji@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 1/6] client: pxar: rename `ReuseStats` struct to PxarArchiverProgressStats
Date: Mon, 13 Jul 2026 10:15:24 +0200	[thread overview]
Message-ID: <20260713081529.62859-2-s.shaji@proxmox.com> (raw)
In-Reply-To: <20260713081529.62859-1-s.shaji@proxmox.com>

Earlier, the `ReuseStats` struct was used to count and show summary for
metadata mode. Since, the same counter will be used to show stats for
both legacy and data mode, rename `ReuseStats` struct to
`PxarArchiverProgressStats` and its corresponding property inside the
`Archiver` to `progress_stats`.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 pbs-client/src/pxar/create.rs | 46 +++++++++++++++++------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/pbs-client/src/pxar/create.rs b/pbs-client/src/pxar/create.rs
index cb66b70b8..ab2b9301c 100644
--- a/pbs-client/src/pxar/create.rs
+++ b/pbs-client/src/pxar/create.rs
@@ -150,7 +150,7 @@ pub(crate) struct HardLinkInfo {
 }
 
 #[derive(Default)]
-struct ReuseStats {
+struct PxarArchiverProgressStats {
     files_reused_count: u64,
     files_hardlink_count: u64,
     files_reencoded_count: u64,
@@ -193,7 +193,7 @@ struct Archiver {
     // an older client without the encode-time check is detected here and the affected file is
     // re-encoded instead of reused.
     last_reusable_offset: Option<u64>,
-    reuse_stats: ReuseStats,
+    progress_stats: PxarArchiverProgressStats,
     split_archive: bool,
 }
 
@@ -304,7 +304,7 @@ where
         previous_payload_index,
         cache: PxarLookaheadCache::new(options.max_cache_size),
         last_reusable_offset: None,
-        reuse_stats: ReuseStats::default(),
+        progress_stats: PxarArchiverProgressStats::default(),
         split_archive,
     };
 
@@ -325,28 +325,28 @@ where
         info!("Change detection summary:");
         info!(
             " - {} total files ({} hardlinks)",
-            archiver.reuse_stats.files_reused_count
-                + archiver.reuse_stats.files_reencoded_count
-                + archiver.reuse_stats.files_hardlink_count,
-            archiver.reuse_stats.files_hardlink_count,
+            archiver.progress_stats.files_reused_count
+                + archiver.progress_stats.files_reencoded_count
+                + archiver.progress_stats.files_hardlink_count,
+            archiver.progress_stats.files_hardlink_count,
         );
         info!(
             " - {} unchanged, reusable files with {} data",
-            archiver.reuse_stats.files_reused_count,
-            HumanByte::from(archiver.reuse_stats.total_reused_payload_size),
+            archiver.progress_stats.files_reused_count,
+            HumanByte::from(archiver.progress_stats.total_reused_payload_size),
         );
         info!(
             " - {} changed or non-reusable files with {} data",
-            archiver.reuse_stats.files_reencoded_count,
-            HumanByte::from(archiver.reuse_stats.total_reencoded_size),
+            archiver.progress_stats.files_reencoded_count,
+            HumanByte::from(archiver.progress_stats.total_reencoded_size),
         );
         info!(
             " - {} padding in {} partially reused chunks",
             HumanByte::from(
-                archiver.reuse_stats.total_injected_size
-                    - archiver.reuse_stats.total_reused_payload_size
+                archiver.progress_stats.total_injected_size
+                    - archiver.progress_stats.total_reused_payload_size
             ),
-            archiver.reuse_stats.partial_chunks_count,
+            archiver.progress_stats.partial_chunks_count,
         );
     }
     Ok(())
@@ -968,24 +968,24 @@ impl Archiver {
                 }
 
                 let offset: LinkOffset = if let Some(payload_offset) = payload_offset {
-                    self.reuse_stats.total_reused_payload_size +=
+                    self.progress_stats.total_reused_payload_size +=
                         file_size + size_of::<pxar::format::Header>() as u64;
-                    self.reuse_stats.files_reused_count += 1;
+                    self.progress_stats.files_reused_count += 1;
 
                     encoder
                         .add_payload_ref(metadata, file_name, file_size, payload_offset)
                         .await?
                 } else {
-                    self.reuse_stats.total_reencoded_size +=
+                    self.progress_stats.total_reencoded_size +=
                         file_size + size_of::<pxar::format::Header>() as u64;
-                    self.reuse_stats.files_reencoded_count += 1;
+                    self.progress_stats.files_reencoded_count += 1;
 
                     self.add_regular_file(encoder, fd, file_name, metadata, file_size)
                         .await?
                 };
 
                 if stat.st_nlink > 1 {
-                    self.reuse_stats.files_hardlink_count += 1;
+                    self.progress_stats.files_hardlink_count += 1;
                     self.hardlinks
                         .insert(link_info, (self.path.clone(), offset));
                 }
@@ -1212,11 +1212,11 @@ impl Archiver {
                     HumanByte::from(chunk.padding),
                     HumanByte::from(chunk.size()),
                 );
-                self.reuse_stats.total_injected_size += chunk.size();
-                self.reuse_stats.total_injected_count += 1;
+                self.progress_stats.total_injected_size += chunk.size();
+                self.progress_stats.total_injected_count += 1;
 
                 if chunk.padding > 0 {
-                    self.reuse_stats.partial_chunks_count += 1;
+                    self.progress_stats.partial_chunks_count += 1;
                 }
 
                 size = size.add(chunk.size());
@@ -2072,7 +2072,7 @@ mod tests {
                 suggested_boundaries: Some(suggested_boundaries),
                 cache: PxarLookaheadCache::new(None),
                 last_reusable_offset: None,
-                reuse_stats: ReuseStats::default(),
+                progress_stats: PxarArchiverProgressStats::default(),
                 split_archive: true,
             };
 
-- 
2.47.3





  reply	other threads:[~2026-07-13  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  8:15 [PATCH proxmox-backup 0/6] fix #7024: add more information inside backup logs Shan Shaji
2026-07-13  8:15 ` Shan Shaji [this message]
2026-07-13  8:15 ` [PATCH proxmox-backup 2/6] client: pxar: use atomic values in `PxarArchiverProgressStats` Shan Shaji
2026-07-13  8:15 ` [PATCH proxmox-backup 3/6] fix #7024: pxar: show archiver summary for legacy and data mode Shan Shaji
2026-07-13  8:15 ` [PATCH proxmox-backup 4/6] client: backup_stats: move `uploaded_len` counter to `UploadCounters` Shan Shaji
2026-07-13  8:15 ` [PATCH proxmox-backup 5/6] fix #7024: cli: add more information inside the backup progress logs Shan Shaji
2026-07-15 12:46   ` Thomas Ellmenreich
2026-07-15 14:06     ` Shan Shaji
2026-07-13  8:15 ` [PATCH proxmox-backup 6/6] fix #7024: cli: add option to enable verbose logs Shan Shaji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260713081529.62859-2-s.shaji@proxmox.com \
    --to=s.shaji@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal