From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 3/3] server: sync: use HumanByte for task log output
Date: Wed, 6 Mar 2024 15:11:53 +0100 [thread overview]
Message-ID: <20240306141153.419283-4-c.ebner@proxmox.com> (raw)
In-Reply-To: <20240306141153.419283-1-c.ebner@proxmox.com>
Use the methods provided by HumanByte for the output for consistency.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/server/pull.rs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/server/pull.rs b/src/server/pull.rs
index 7d745c77..fc369056 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -9,6 +9,7 @@ use std::time::{Duration, SystemTime};
use anyhow::{bail, format_err, Error};
use http::StatusCode;
+use proxmox_human_byte::HumanByte;
use proxmox_rest_server::WorkerTask;
use proxmox_router::HttpError;
use proxmox_sys::{task_log, task_warn};
@@ -657,9 +658,9 @@ async fn pull_index_chunks<I: IndexFile>(
task_log!(
worker,
- "downloaded {} bytes ({:.2} MiB/s)",
- bytes,
- (bytes as f64) / (1024.0 * 1024.0 * elapsed.as_secs_f64())
+ "downloaded {} ({}/s)",
+ HumanByte::from(bytes),
+ HumanByte::new_binary(bytes as f64 / elapsed.as_secs_f64()),
);
Ok(PullStats {
--
2.39.2
next prev parent reply other threads:[~2024-03-06 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 14:11 [pbs-devel] [PATCH proxmox-backup 0/3] fix #5285: log global statistics for sync job Christian Ebner
2024-03-06 14:11 ` [pbs-devel] [PATCH proxmox-backup 1/3] server: sync: return `PullStats` for pull related methods Christian Ebner
2024-03-06 14:11 ` [pbs-devel] [PATCH proxmox-backup 2/3] fix #5285: api: sync: add job summary to task log Christian Ebner
2024-03-06 14:11 ` Christian Ebner [this message]
2024-03-06 17:29 ` [pbs-devel] [PATCH proxmox-backup 0/3] fix #5285: log global statistics for sync job Max Carrara
2024-03-07 10:55 ` Max Carrara
2024-03-07 13:59 ` [pbs-devel] applied-series: " Thomas Lamprecht
2024-03-07 14:11 ` Christian 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=20240306141153.419283-4-c.ebner@proxmox.com \
--to=c.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.