public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dietmar Maurer <dietmar@proxmox.com>
Subject: Re: [pbs-devel] [RFC proxmox-backup v3 1/2] pbs-api-types: more flexible HumanByte type
Date: Sat, 20 Nov 2021 22:55:21 +0100	[thread overview]
Message-ID: <1fdb071e-31b1-6f64-0384-31cf93197781@proxmox.com> (raw)
In-Reply-To: <20211118072922.2233682-2-dietmar@proxmox.com>

On 18.11.21 08:29, Dietmar Maurer wrote:
> This implements a parser for human readabkle byte sizes.
> 
> Examples: "1KB", "1.5 Mib", "3T"
> 
> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
> ---
>  pbs-api-types/src/human_byte.rs   | 353 ++++++++++++++++++++++++++++++
>  pbs-api-types/src/lib.rs          |   3 +
>  pbs-client/src/backup_writer.rs   |  19 +-
>  pbs-datastore/src/datastore.rs    |  13 +-
>  pbs-tools/Cargo.toml              |   1 +
>  pbs-tools/src/format.rs           |  55 +----
>  src/bin/proxmox-tape.rs           |   7 +-
>  src/server/email_notifications.rs |   5 +-
>  8 files changed, 382 insertions(+), 74 deletions(-)
>  create mode 100644 pbs-api-types/src/human_byte.rs
> 
>

I replaced this commit by four separate ones:

42ba4cd3 human byte: make proper proxmox API type
ab1c07a6 human byte: add from string parser
930a7146 human byte: add proper unit type and support base-10
a58a5cf7 move HumanByte to pbs-abi-types crate

I based it quite a bit on the semantics of yours. But made a few changes, the
two commits in the middle contain a bit more info in the commit message.

Also incorporated a bit of your code 1:1 and all of your (adapted) tests, plus
added a few more.

IMO the result is OK'ish and definitively better than my lousy original one, if
you find issues or don't like some changes feel free to adapt, thanks!




  reply	other threads:[~2021-11-20 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  7:29 [pbs-devel] [RFC proxmox-backup v3 0/2] " Dietmar Maurer
2021-11-18  7:29 ` [pbs-devel] [RFC proxmox-backup v3 1/2] pbs-api-types: " Dietmar Maurer
2021-11-20 21:55   ` Thomas Lamprecht [this message]
2021-11-18  7:29 ` [pbs-devel] [RFC proxmox-backup v3 2/2] use HumanByte for traffic-control config Dietmar Maurer
2021-11-20 21:55   ` [pbs-devel] applied: " Thomas Lamprecht
2021-11-18  9:28 ` [pbs-devel] [RFC proxmox-backup v3 0/2] more flexible HumanByte type Fabian Ebner

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=1fdb071e-31b1-6f64-0384-31cf93197781@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=dietmar@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