pub fn save(&self, file: String) {
        let mut file_handle = File::create(file.clone()).unwrap();

        let config = format!(
            "{} {} {} {:?} {} {:?}\n",
            self.config.precision,
            self.config.max_memory,
            self.config.max_value,
            self.config.slice_duration,
            self.config.num_slices,
            self.config.start
        ).into_bytes();
        let _ = file_handle.write_all(&config);

        for slice in self {
            let histogram = slice.histogram.clone();
            for bucket in &histogram {
                if bucket.count() > 0 {
                    let line = format!("{:?} {} {}\n", slice.start, bucket.value(), bucket.count())
                        .into_bytes();
                    let _ = file_handle.write_all(&line);
                }
            }
        }
    }
/// save the `Heatmap` to disk. NOTE: format may change in future
save the `Heatmap` to disk. NOTE: format may change in future
save the ` Heatmap ` to disk . NOTE : format may change in future
pub fn save(&self, file: String) {
        let mut file_handle = File::create(file.clone()).unwrap();
        let config = format!(
            "{} {} {} {:?} {} {:?}\n",
            self.config.precision,
            self.config.max_memory,
            self.config.max_value,
            self.config.slice_duration,
            self.config.num_slices,
            self.config.start
        ).into_bytes();
        let _ = file_handle.write_all(&config);
        for slice in self {
            let histogram = slice.histogram.clone();
            for bucket in &histogram {
                if bucket.count() > 0 {
                    let line = format!("{:?} {} {}\n", slice.start, bucket.value(), bucket.count())
                        .into_bytes();
                    let _ = file_handle.write_all(&line);
                }
            }
        }
    }
pub fn save ( & self , file : String ) { let mut file_handle = File :: create ( file . clone ( ) ) . unwrap ( ) ; let config = format ! ( " \n " self config precision self config max_memory self config max_value self config slice_duration self config num_slices self config start ) . into_bytes ( ) ; let _ = file_handle . write_all ( & config ) ; for slice in self { let histogram = slice . histogram . clone ( ) ; for bucket in & histogram { if bucket . count ( ) > 0 { let line = format ! ( " \n " slice start bucket value ( ) bucket count ( ) ) . into_bytes ( ) ; let _ = file_handle . write_all ( & line ) ; } } } }
save the `Heatmap` to disk.
save the ` Heatmap ` to disk .
&self
file
String