A command line tool to record process and system performance data.
Install with cargo
:
shell
cargo install precord
shell
precord -p 1203 -o result.svg
-c / --category
- categories for recording, possible values:
cpu
- CPU usage of processmem
- Memory usage of processgpu
- GPU usage of processfps
- Frame rate of processsys_cpu_freq
- CPU frequency of systemsys_gpu
- GPU usage of system-p / --process
- ID of processes--name
- Name of processes-o / --output
- Output of recording result, possible extensions:
.svg
.json
.csv
-i / --interval
- Interval of recording-n
- Count of recording-r / --recurse_children
- Flag to recurse child processesA library for retrieving process and system performance data.
```rust use precord_core::{Features, System}; use std::thread; use std::time::Duration;
fn main() { let mut system = System::new(Features::PROCESS || Features::GPU, [1203]); system.update();
thread::sleep(Duration::from_secs(1)); system.update();
if let Some(cpuusage) = system.processcpuusage(1203) { println!("Process({}) %CPU: {:.2}%", 1203, cpuusage) }
#[cfg(targetos = "windows")] if let Some(gpuusage) = system.processgpuusage(1203) { println!("Process({}) %GPU: {:.2}%", 1203, gpu_usage) }
if let Some(sysgpuusage) = system.systemgpuusage() { println!("System %GPU: {:.2}%", sysgpuusage); } } ```
| | macOS | Windows | |--------------|--------------------|--------------------| | cpu | :whitecheckmark: | :whitecheckmark: | | mem | :whitecheckmark: | :whitecheckmark: | | gpu | | :whitecheckmark: | | fps | | :whitecheckmark: | | syscpufreq | :whitecheckmark: | :whitecheckmark: | | sysgpu | :whitecheckmark: | :whitecheck_mark: |
| | macOS | Windows |
|----------------------------------------------------|---------------|---------------|
| cpu | | |
| mem | | |
| gpu | | |
| fps | | Administrator |
| syscpufreq | Administrator | |
| sys_gpu | | |
| system processes
(WindowServer, dwm.exe, etc.) | Administrator | Administrator |
Rust
Go
Python