From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.ebner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 68E0580829
 for <pbs-devel@lists.proxmox.com>; Thu, 18 Nov 2021 10:33:15 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 5ACDD184E6
 for <pbs-devel@lists.proxmox.com>; Thu, 18 Nov 2021 10:33:15 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id B79C3184D8
 for <pbs-devel@lists.proxmox.com>; Thu, 18 Nov 2021 10:33:14 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D014543D54
 for <pbs-devel@lists.proxmox.com>; Thu, 18 Nov 2021 10:28:06 +0100 (CET)
To: pbs-devel@lists.proxmox.com, Dietmar Maurer <dietmar@proxmox.com>
References: <20211118072922.2233682-1-dietmar@proxmox.com>
From: Fabian Ebner <f.ebner@proxmox.com>
Message-ID: <d04a5322-4f71-8cde-9ff1-6ecd9737343e@proxmox.com>
Date: Thu, 18 Nov 2021 10:28:00 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.14.0
MIME-Version: 1.0
In-Reply-To: <20211118072922.2233682-1-dietmar@proxmox.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.685 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -1.009 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pbs-devel] [RFC proxmox-backup v3 0/2] more flexible HumanByte
 type
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Nov 2021 09:33:15 -0000

Am 18.11.21 um 08:29 schrieb Dietmar Maurer:
> Changes since v2:
> 
>   - reverted changes from v2

Should there be separate types for byte rates that are represented with 
float + unit, and for byte sizes that are represented with an integer 
internally? After all, 1.2MiB/s "exists", but 1.2MiB does not ;)

> 
>   - restrict number of possibleunits (always store KB instead of K)
>   
>   - store size without scaling to unit (avoid rounding errors in
>     deserialze/serialze)
> 
>   - allow to specify precision in Display
> 
>   - new with_unit() constructor
> 
>   - improved dev docs
> 
> Changes since v1:
> 
> - do not expose auto_unit functions
> - store size as u64 (suggested by thomas)
> - do not store unit (suggested by thomas)
> 
> 
> *** BLURB HERE ***
> 
> Dietmar Maurer (2):
>    pbs-api-types: more flexible HumanByte type
>    use HumanByte for traffic-control config
> 
>   pbs-api-types/src/human_byte.rs      | 353 +++++++++++++++++++++++++++
>   pbs-api-types/src/lib.rs             |   3 +
>   pbs-api-types/src/traffic_control.rs |  18 +-
>   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/cached_traffic_control.rs        |  18 +-
>   src/server/email_notifications.rs    |   5 +-
>   10 files changed, 403 insertions(+), 89 deletions(-)
>   create mode 100644 pbs-api-types/src/human_byte.rs
>