rtopm 0.1.0

A modern TUI system resource monitor with Docker and disk I/O tracking
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use sysinfo::System;

fn main() {
    let mut sys = System::new_all();
    sys.refresh_all();
    if let Some((pid, process)) = sys.processes().iter().next() {
        let thread_count = process.tasks().map(|t| t.len()).unwrap_or(1);
        println!(
            "PID: {}, name: {}, threads: {}",
            pid,
            process.name(),
            thread_count
        );
    }
}