]> git.proxmox.com Git - proxmox-backup.git/blobdiff - proxmox-rrd/src/cache.rs
rrd_cache: use `proxmox-rrd` from `proxmox` workspace
[proxmox-backup.git] / proxmox-rrd / src / cache.rs
index 90e4e47035c94f8cb6c85ef336f41398fc4d8ec6..254010f3547b199d1ae2fa5cf6b8932ad2da54a1 100644 (file)
@@ -13,6 +13,7 @@ use crossbeam_channel::{bounded, TryRecvError};
 use proxmox_sys::fs::{create_path, CreateOptions};
 
 use crate::rrd::{CF, DST, RRA, RRD};
+use crate::Entry;
 
 mod journal;
 use journal::*;
@@ -101,7 +102,7 @@ impl RRDCache {
     /// * cf=average,r=7*86400,n=570 => 10years
     /// * cf=maximum,r=7*86400,n=570 => 10year
     ///
-    /// The resultion data file size is about 80KB.
+    /// The resulting data file size is about 80KB.
     pub fn create_proxmox_backup_default_rrd(dst: DST) -> RRD {
         let rra_list = vec![
             // 1 min * 1440 => 1 day
@@ -206,7 +207,7 @@ impl RRDCache {
 
     /// Extract data from cached RRD
     ///
-    /// `start`: Start time. If not sepecified, we simply extract 10 data points.
+    /// `start`: Start time. If not specified, we simply extract 10 data points.
     ///
     /// `end`: End time. Default is to use the current time.
     pub fn extract_cached_data(
@@ -217,7 +218,7 @@ impl RRDCache {
         resolution: u64,
         start: Option<u64>,
         end: Option<u64>,
-    ) -> Result<Option<(u64, u64, Vec<Option<f64>>)>, Error> {
+    ) -> Result<Option<Entry>, Error> {
         self.rrd_map
             .read()
             .unwrap()
@@ -429,7 +430,7 @@ fn commit_journal_impl(
 
     for rel_path in files.iter() {
         let mut path = config.basedir.clone();
-        path.push(&rel_path);
+        path.push(rel_path);
         fsync_file_or_dir(&path)
             .map_err(|err| format_err!("fsync rrd file {} failed - {}", rel_path, err))?;
     }