From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 9C96D80489 for ; Wed, 17 Nov 2021 14:37:55 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9166FD5D2 for ; Wed, 17 Nov 2021 14:37:25 +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 09998D5C0 for ; Wed, 17 Nov 2021 14:37:24 +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 D689243D9A; Wed, 17 Nov 2021 14:37:23 +0100 (CET) From: Dietmar Maurer To: pbs-devel@lists.proxmox.com Date: Wed, 17 Nov 2021 14:37:16 +0100 Message-Id: <20211117133720.1799124-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.495 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox-tape.rs, format.rs, datastore.rs, lib.rs] Subject: [pbs-devel] [RFC proxmox-backup v2 0/4] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2021 13:37:55 -0000 Changes since v1: - do not expose auto_unit functions - store size as u64 (suggested by thomas) - do not store unit (suggested by thomas) The disadvantage is that the config value does not exactly match the value you set, for example: proxmox-backup-manager traffic-control update rule0 --rate-out 1.2mib config contains "1.198 MiB" proxmox-backup-manager traffic-control update rule0 --rate-out 1200kib config contains "1.17 MiB" Dietmar Maurer (4): pbs-api-types: more flexible HumanByte type use HumanByte for traffic-control config HumanByte: use u64 instead of f64 to store size HumanByte: do not store unit (always compute canonical form) pbs-api-types/src/human_byte.rs | 326 +++++++++++++++++++++++++++ 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, 376 insertions(+), 89 deletions(-) create mode 100644 pbs-api-types/src/human_byte.rs -- 2.30.2