fn clean_old_records(&mut self) {
        let record_ptr = &self.record_buffer[0];
        let record_size = size_of_val(record_ptr);
        let curr_size = record_size * self.record_buffer.len();
        trace!(
            "topology: current size of record buffer: {} max size: {}",
            curr_size,
            self.buffer_max_kbytes * 1000
        );
        if curr_size as u16 > self.buffer_max_kbytes * 1000 {
            let size_diff = curr_size - (self.buffer_max_kbytes * 1000) as usize;
            trace!(
                "topology: size_diff: {} record size: {}",
                size_diff,
                record_size
            );
            if size_diff > record_size {
                let nb_records_to_delete = size_diff as f32 / record_size as f32;
                for _ in 1..nb_records_to_delete as u32 {
                    if !self.record_buffer.is_empty() {
                        let res = self.record_buffer.remove(0);
                        debug!("Cleaning record buffer on Topology, removing: {:?}", res);
                    }
                }
            }
        }
    }
/// Removes (and thus drops) as many Record instances from the record_buffer
/// as needed for record_buffer to not exceed 'buffer_max_kbytes'
Removes (and thus drops) as many Record instances from the record_buffer
as needed for record_buffer to not exceed 'buffer_max_kbytes'
Removes ( and thus drops ) as many Record instances from the record_buffer as needed for record_buffer to not exceed ' buffer_max_kbytes '
fn clean_old_records(&mut self) {
        let record_ptr = &self.record_buffer[0];
        let record_size = size_of_val(record_ptr);
        let curr_size = record_size * self.record_buffer.len();
        trace!(
            "topology: current size of record buffer: {} max size: {}",
            curr_size,
            self.buffer_max_kbytes * 1000
        );
        if curr_size as u16 > self.buffer_max_kbytes * 1000 {
            let size_diff = curr_size - (self.buffer_max_kbytes * 1000) as usize;
            trace!(
                "topology: size_diff: {} record size: {}",
                size_diff,
                record_size
            );
            if size_diff > record_size {
                let nb_records_to_delete = size_diff as f32 / record_size as f32;
                for _ in 1..nb_records_to_delete as u32 {
                    if !self.record_buffer.is_empty() {
                        let res = self.record_buffer.remove(0);
                        debug!("Cleaning record buffer on Topology, removing: {:?}", res);
                    }
                }
            }
        }
    }
fn clean_old_records ( & mut self ) { let record_ptr = & self . record_buffer [ 0 ] ; let record_size = size_of_val ( record_ptr ) ; let curr_size = record_size * self . record_buffer . len ( ) ; trace ! ( " " curr_size self buffer_max_kbytes 1000 ) ; if curr_size as u16 > self . buffer_max_kbytes * 1000 { let size_diff = curr_size - ( self . buffer_max_kbytes * 1000 ) as usize ; trace ! ( " " size_diff record_size ) ; if size_diff > record_size { let nb_records_to_delete = size_diff as f32 / record_size as f32 ; for _ in 1 .. nb_records_to_delete as u32 { if ! self . record_buffer . is_empty ( ) { let res = self . record_buffer . remove ( 0 ) ; debug ! ( " " res ) ; } } } } }
Removes (and thus drops) as many Record instances from the record_buffer
as needed for record_buffer to not exceed 'buffer_max_kbytes'
Removes ( and thus drops ) as many Record instances from the record_buffer as needed for record_buffer to not exceed ' buffer_max_kbytes '
&mut self
&mut self