[pbs-devel] [PATCH proxmox-backup 08/15] proxmox-rrd: support CF::Last

Dietmar Maurer dietmar at proxmox.com
Wed Oct 13 10:24:45 CEST 2021


---
 proxmox-rrd/src/rrd.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/proxmox-rrd/src/rrd.rs b/proxmox-rrd/src/rrd.rs
index 328ac9f2..7a9ce94a 100644
--- a/proxmox-rrd/src/rrd.rs
+++ b/proxmox-rrd/src/rrd.rs
@@ -51,6 +51,8 @@ pub enum CF {
     Maximum,
     /// Minimum
     Minimum,
+    /// Use the last value
+    Last,
 }
 
 #[derive(Serialize, Deserialize)]
@@ -209,6 +211,7 @@ impl RRA {
             let new_value = match self.cf {
                 CF::Maximum => if last_value > value { last_value } else { value },
                 CF::Minimum => if last_value < value { last_value } else { value },
+                CF::Last => value,
                 CF::Average => {
                     (last_value*(self.last_count as f64))/(new_count as f64)
                         + value/(new_count as f64)
-- 
2.30.2






More information about the pbs-devel mailing list