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 1/5] api-types: add an UploadStatistic api type
Date: Tue, 28 Nov 2023 10:43:58 +0100	[thread overview]
Message-ID: <20231128094402.38115-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20231128094402.38115-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 1f619c9d..14dc1cc1 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.39.2




  reply	other threads:[~2023-11-28  9:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  9:43 [pbs-devel] [PATCH proxmox-backup 0/5] add context menu to datastore content Dominik Csapak
2023-11-28  9:43 ` Dominik Csapak [this message]
2023-11-28  9:43 ` [pbs-devel] [PATCH proxmox-backup 2/5] api: datastore admin: add 'snapshot-information' api call Dominik Csapak
2023-11-28  9:44 ` [pbs-devel] [PATCH proxmox-backup 3/5] ui: datastore content: add context menu to groups and snapshots Dominik Csapak
2023-11-28 15:27   ` [pbs-devel] applied: " Thomas Lamprecht
2023-11-29  7:35     ` Dominik Csapak
2023-11-29  7:47       ` Thomas Lamprecht
2023-11-28  9:44 ` [pbs-devel] [PATCH proxmox-backup 4/5] ui: datastore content: add snapshot information to context menu Dominik Csapak
2023-11-28  9:44 ` [pbs-devel] [PATCH proxmox-backup 5/5] ui: datastore content: add 'more actions' menu to actions Dominik Csapak
2023-11-28 11:32 ` [pbs-devel] [PATCH proxmox-backup 0/5] add context menu to datastore content Fabian Grünbichler
2023-11-28 12:48 ` Philipp Hufnagl
2023-11-28 13:41 ` Max Carrara

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=20231128094402.38115-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