public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] api2/status: fix estimation bug
@ 2020-07-17 13:39 Dominik Csapak
  2020-07-17 13:39 ` [pbs-devel] [PATCH proxmox-backup 2/2] examples/upload-speed: adapt to change Dominik Csapak
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dominik Csapak @ 2020-07-17 13:39 UTC (permalink / raw)
  To: pbs-devel

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-21 11:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 13:39 [pbs-devel] [PATCH proxmox-backup 1/2] api2/status: fix estimation bug Dominik Csapak
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

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