public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2 1/4] api-types: add an UploadStatistic api type
Date: Tue,  5 Dec 2023 11:53:42 +0100	[thread overview]
Message-ID: <20231205105345.1656325-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20231205105345.1656325-1-d.csapak@proxmox.com>

We'll want this to expose on the api, but the internal type used in the
backup environment does not use kebab case, so simply add a new type

I opted for a new type instead of modifying the existing one, so that we
keep the casing for the options in the manifest the same.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-api-types/src/datastore.rs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index d4ead1d1..52f83f48 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -421,6 +421,22 @@ pub struct SnapshotVerifyState {
     pub state: VerifyState,
 }
 
+#[api()]
+#[derive(Copy, Clone, Serialize, Deserialize, PartialEq)]
+#[serde(rename_all = "kebab-case")]
+/// Chunk upload statistics of a snapshot
+pub struct UploadStatistic {
+    /// Amount of chunks uploaded (incl. duplicates)
+    pub count: u64,
+    /// Uncompressed bytes uploaded
+    pub size: u64,
+    /// Compressed bytes uploaded
+    #[serde(alias = "compressed_size")]
+    pub compressed_size: u64,
+    /// Amount of duplicate chunks uploaded
+    pub duplicates: u64,
+}
+
 /// A namespace provides a logical separation between backup groups from different domains
 /// (cluster, sites, ...) where uniqueness cannot be guaranteed anymore. It allows users to share a
 /// datastore (i.e., one deduplication domain (chunk store)) with multiple (trusted) sites and
-- 
2.30.2





  reply	other threads:[~2023-12-05 10:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 10:53 [pbs-devel] [PATCH proxmox-backup v2 0/4] add 'show information' for snapshots Dominik Csapak
2023-12-05 10:53 ` Dominik Csapak [this message]
2023-12-05 10:53 ` [pbs-devel] [PATCH proxmox-backup v2 2/4] api: datastore admin: add 'snapshot-information' api call Dominik Csapak
2023-12-05 10:53 ` [pbs-devel] [PATCH proxmox-backup v2 3/4] ui: datastore content: add snapshot information to context menu Dominik Csapak
2023-12-05 10:53 ` [pbs-devel] [PATCH proxmox-backup v2 4/4] ui: datastore content: add 'more actions' menu to actions Dominik Csapak

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=20231205105345.1656325-2-d.csapak@proxmox.com \
    --to=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal