fn start(&mut self, mtx: std::sync::mpsc::Sender<u8>) {
        // Event thread
        // This needs to be done BEFORE any other child threads are spawned
        // so the rules for signal handling are inherited to all child threads
        self.threads.push(
            events::start_thread(
                Arc::clone(&self.inputbuffer),
                Arc::clone(&self.config),
                mtx.clone(),
            )
        );

        // Update frequency
        let sleepy = std::time::Duration::from_millis(self.config.frequency.load(atomic::Ordering::Relaxed));

        // Read /proc/stat
        self.threads.push(
            cpu::start_thread(
                Arc::clone(&self.cpuinfo),
                 mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );

        // Processes
        self.threads.push(
            processes::start_thread(
                Arc::clone(&self.processinfo),
                Arc::clone(&self.cpuinfo),
                Arc::clone(&self.config),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );

        // Time loop
        self.threads.push(
            time::start_thread(
                Arc::clone(&self.time),
                mtx.clone(),
                Arc::clone(&self.exit)
            )
        );

        // Read /proc/loadavg
        self.threads.push(
            loadavg::start_thread(
                Arc::clone(&self.loadavg),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );

        // Read /proc/meminfo
        self.threads.push(
            memory::start_thread(
                Arc::clone(&self.memoryinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );

        // Sensors
        self.threads.push(
            sensors::start_thread(
                Arc::clone(&self.sensorinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                sleepy
            )
        );

        // Network
        self.threads.push(
            network::start_thread(
                Arc::clone(&self.networkinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );

        // GPU
        self.threads.push(
            gpu::start_thread(
                Arc::clone(&self.gpuinfo),
                mtx,
                Arc::clone(&self.exit),
                sleepy
            )
        );
    }
// This function starts all the monitoring threads
This function starts all the monitoring threads
This function starts all the monitoring threads
fn start(&mut self, mtx: std::sync::mpsc::Sender<u8>) {
        // Event thread
        // This needs to be done BEFORE any other child threads are spawned
        // so the rules for signal handling are inherited to all child threads
        self.threads.push(
            events::start_thread(
                Arc::clone(&self.inputbuffer),
                Arc::clone(&self.config),
                mtx.clone(),
            )
        );
        // Update frequency
        let sleepy = std::time::Duration::from_millis(self.config.frequency.load(atomic::Ordering::Relaxed));
        // Read /proc/stat
        self.threads.push(
            cpu::start_thread(
                Arc::clone(&self.cpuinfo),
                 mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );
        // Processes
        self.threads.push(
            processes::start_thread(
                Arc::clone(&self.processinfo),
                Arc::clone(&self.cpuinfo),
                Arc::clone(&self.config),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );
        // Time loop
        self.threads.push(
            time::start_thread(
                Arc::clone(&self.time),
                mtx.clone(),
                Arc::clone(&self.exit)
            )
        );
        // Read /proc/loadavg
        self.threads.push(
            loadavg::start_thread(
                Arc::clone(&self.loadavg),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );
        // Read /proc/meminfo
        self.threads.push(
            memory::start_thread(
                Arc::clone(&self.memoryinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );
        // Sensors
        self.threads.push(
            sensors::start_thread(
                Arc::clone(&self.sensorinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                sleepy
            )
        );
        // Network
        self.threads.push(
            network::start_thread(
                Arc::clone(&self.networkinfo),
                mtx.clone(),
                Arc::clone(&self.exit),
                Arc::clone(&self.error),
                sleepy
            )
        );
        // GPU
        self.threads.push(
            gpu::start_thread(
                Arc::clone(&self.gpuinfo),
                mtx,
                Arc::clone(&self.exit),
                sleepy
            )
        );
    }
fn start ( & mut self , mtx : std :: sync :: mpsc :: Sender < u8 > ) { // Event thread // This needs to be done BEFORE any other child threads are spawned // so the rules for signal handling are inherited to all child threads self . threads . push ( events :: start_thread ( Arc :: clone ( & self . inputbuffer ) , Arc :: clone ( & self . config ) , mtx . clone ( ) , ) ) ; // Update frequency let sleepy = std :: time :: Duration :: from_millis ( self . config . frequency . load ( atomic :: Ordering :: Relaxed ) ) ; // Read /proc/stat self . threads . push ( cpu :: start_thread ( Arc :: clone ( & self . cpuinfo ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , Arc :: clone ( & self . error ) , sleepy ) ) ; // Processes self . threads . push ( processes :: start_thread ( Arc :: clone ( & self . processinfo ) , Arc :: clone ( & self . cpuinfo ) , Arc :: clone ( & self . config ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , Arc :: clone ( & self . error ) , sleepy ) ) ; // Time loop self . threads . push ( time :: start_thread ( Arc :: clone ( & self . time ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) ) ) ; // Read /proc/loadavg self . threads . push ( loadavg :: start_thread ( Arc :: clone ( & self . loadavg ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , Arc :: clone ( & self . error ) , sleepy ) ) ; // Read /proc/meminfo self . threads . push ( memory :: start_thread ( Arc :: clone ( & self . memoryinfo ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , Arc :: clone ( & self . error ) , sleepy ) ) ; // Sensors self . threads . push ( sensors :: start_thread ( Arc :: clone ( & self . sensorinfo ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , sleepy ) ) ; // Network self . threads . push ( network :: start_thread ( Arc :: clone ( & self . networkinfo ) , mtx . clone ( ) , Arc :: clone ( & self . exit ) , Arc :: clone ( & self . error ) , sleepy ) ) ; // GPU self . threads . push ( gpu :: start_thread ( Arc :: clone ( & self . gpuinfo ) , mtx , Arc :: clone ( & self . exit ) , sleepy ) ) ; }
This function starts all the monitoring threads
This function starts all the monitoring threads
&mut self
mtx
std::sync::mpsc::Sender<u8>