precord

crates.io docs.rs Minimum rustc version

Command line tool for recording process or system performance data.

Installation

Install with cargo:

shell cargo install precord

Usage

shell precord -p 1203 -o result.svg

Options

shell precord -h

Command Mode

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 - time - modify time limit for recording

precord-core

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); } } ```

Supported Platforms

| | macOS | Windows | Linux | |----------------------|--------------------|--------------------|--------------------| | cpu | :whitecheckmark: | :whitecheckmark: | :whitecheckmark: | | mem | :whitecheckmark: | :whitecheckmark: | :whitecheckmark: | | gpu | | :whitecheckmark: | | | vram | | :whitecheckmark: | | | fps | :whitecheckmark: | :whitecheckmark: | | | netin/netout | :whitecheckmark: | :whitecheckmark: | | | diskread/diskwrite | :whitecheckmark: | | | | kobject | :whitecheckmark: | :whitecheckmark: | | | syscpu | :whitecheckmark: | :whitecheckmark: | :whitecheckmark: | | syscpufreq | :whitecheckmark: | :whitecheckmark: | :whitecheckmark: | | syscputemp | :whitecheckmark: | :whitecheckmark: | | | sysgpu | :whitecheckmark: | :whitecheckmark: | |

Privileges

| | macOS | Windows | Linux | |----------------------------------------------------|--------------------------------|---------------|-------| | cpu | | | | | mem | | | | | gpu | | | | | vram | | | | | fps | Administrator + get-task-allow | Administrator | | | netin/netout | | Administrator | | | diskread/diskwrite | | | | | kobject | | | | | syscpu | | | | | syscpufreq | Administrator | | | | syscputemp | | | | | sysgpu | | | | | system processes
(WindowServer, dwm.exe, etc.) | Administrator | Administrator | |

TODO

Related projects