From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] api2/status: fix estimation bug
Date: Fri, 17 Jul 2020 15:39:16 +0200 [thread overview]
Message-ID: <20200717133917.4621-1-d.csapak@proxmox.com> (raw)
when a datastore has enough data to calculate the estimated full date,
but always has exactly the same usage, the factor b of the regression
is '0'
return 0 for that case so that the gui can show 'never' instead of
'not enough data'
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/api2/status.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/api2/status.rs b/src/api2/status.rs
index 34e0505..4f98543 100644
--- a/src/api2/status.rs
+++ b/src/api2/status.rs
@@ -161,6 +161,8 @@ fn datastore_status(
if b != 0.0 {
let estimate = (1.0 - a) / b;
entry["estimated-full-date"] = Value::from(estimate.floor() as u64);
+ } else {
+ entry["estimated-full-date"] = Value::from(0);
}
}
}
--
2.20.1
next reply other threads:[~2020-07-17 13:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 13:39 Dominik Csapak [this message]
2020-07-17 13:39 ` [pbs-devel] [PATCH proxmox-backup 2/2] examples/upload-speed: adapt to change Dominik Csapak
2020-07-20 8:22 ` [pbs-devel] applied: " Fabian Grünbichler
2020-07-20 9:36 ` [pbs-devel] [PATCH proxmox-backup 1/2] api2/status: fix estimation bug Thomas Lamprecht
2020-07-20 14:37 ` Dominik Csapak
2020-07-20 14:48 ` Thomas Lamprecht
2020-07-21 11:10 ` [pbs-devel] applied: " Thomas Lamprecht
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=20200717133917.4621-1-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