Command line tool for recording process or system performance data.
Install with cargo
:
shell
cargo install precord
shell
precord -p 1203 -o result.svg
shell
precord -h
-c / --category
- categories for recording, possible values:
cpu
- CPU usage of processmem
- Memory usage of processgpu
- GPU usage of processfps
- Frame rate of processnet_in/net_out
- Network recv/send of processsys_cpu_freq
- CPU frequency of systemsys_cpu_temp
- CPU temperature of systemsys_gpu
- GPU usage of system-p / --process
- ID of processes--name
- Name of processes-o / --output
- Specify the output file, possible extensions:
.svg
.html
.json
.csv
-i / --interval
- Interval for recording-n
- Count for recording--time
- Time limit for recording , e.g., --time 1h30m59s
-r / --recurse-children
- Flag to recurse child processes--skip
- Number of skip records--gpu-calc
- Gpu calculation, possible values:
max
sum
Type :
during recording will enter the command mode, and press Esc
will back to recording. The supported commands are:
- w
- Write(Save) output
- q
- Exit
- wq
- Combination of w
and q
A library for retrieving process and system performance data.
```rust use precord_core::{Features, GpuCalculation, System}; use std::thread; use std::time::Duration;
fn main() { let mut system = System::new(Features::PROCESS || Features::GPU, [1203]).unwrap(); 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, GpuCalculation::Max) { println!("Process({}) %GPU: {:.2}%", 1203, gpu_usage) }
if let Some(sysgpuusage) = system.systemgpuusage(GpuCalculation::Max) { println!("System %GPU: {:.2}%", sysgpuusage); } } ```
| | macOS | Windows | |----------------|--------------------|--------------------| | cpu | :whitecheckmark: | :whitecheckmark: | | mem | :whitecheckmark: | :whitecheckmark: | | gpu | | :whitecheckmark: | | fps | :whitecheckmark: | :whitecheckmark: | | netin/netout | :whitecheckmark: | :whitecheckmark: | | syscpufreq | :whitecheckmark: | :whitecheckmark: | | syscputemp | :whitecheckmark: | :whitecheckmark: | | sysgpu | :whitecheckmark: | :whitecheck_mark: |
| | macOS | Windows |
|----------------------------------------------------|--------------------------------|---------------|
| cpu | | |
| mem | | |
| gpu | | |
| fps | Administrator + get-task-allow | Administrator |
| netin/netout | | Administrator |
| syscpufreq | Administrator | |
| syscputemp | | |
| sys_gpu | | |
| system processes
(WindowServer, dwm.exe, etc.) | Administrator | Administrator |