fn refresh_record(&mut self) {
        let mut value: u64 = 0;
        let mut last_timestamp = current_system_time_since_epoch();
        for s in self.get_sockets() {
            let records = s.get_records_passive();
            if !records.is_empty() {
                let last = records.last();
                let last_record = last.unwrap();
                last_timestamp = last_record.timestamp;
                let res = last_record.value.trim();
                if let Ok(val) = res.parse::<u64>() {
                    value += val;
                } else {
                    trace!("couldn't parse value : {}", res);
                }
            }
        }
        let record = Record::new(last_timestamp, value.to_string(), units::Unit::MicroJoule);

        self.record_buffer.push(record);

        if !self.record_buffer.is_empty() {
            self.clean_old_records();
        }
    }
/// Computes a new Record, stores it in the record_buffer
/// and returns a clone of this record.
///
Computes a new Record, stores it in the record_buffer
and returns a clone of this record.
Computes a new Record stores it in the record_buffer and returns a clone of this record .
fn refresh_record(&mut self) {
        let mut value: u64 = 0;
        let mut last_timestamp = current_system_time_since_epoch();
        for s in self.get_sockets() {
            let records = s.get_records_passive();
            if !records.is_empty() {
                let last = records.last();
                let last_record = last.unwrap();
                last_timestamp = last_record.timestamp;
                let res = last_record.value.trim();
                if let Ok(val) = res.parse::<u64>() {
                    value += val;
                } else {
                    trace!("couldn't parse value : {}", res);
                }
            }
        }
        let record = Record::new(last_timestamp, value.to_string(), units::Unit::MicroJoule);
        self.record_buffer.push(record);
        if !self.record_buffer.is_empty() {
            self.clean_old_records();
        }
    }
fn refresh_record ( & mut self ) { let mut value : u64 = 0 ; let mut last_timestamp = current_system_time_since_epoch ( ) ; for s in self . get_sockets ( ) { let records = s . get_records_passive ( ) ; if ! records . is_empty ( ) { let last = records . last ( ) ; let last_record = last . unwrap ( ) ; last_timestamp = last_record . timestamp ; let res = last_record . value . trim ( ) ; if let Ok ( val ) = res . parse :: < u64 > ( ) { value += val ; } else { trace ! ( " " res ) ; } } } let record = Record :: new ( last_timestamp , value . to_string ( ) , units :: Unit :: MicroJoule ) ; self . record_buffer . push ( record ) ; if ! self . record_buffer . is_empty ( ) { self . clean_old_records ( ) ; } }
Computes a new Record, stores it in the record_buffer
and returns a clone of this record.
Computes a new Record stores it in the record_buffer and returns a clone of this record .
&mut self
&mut self