ryzen-reader 0.1.1

Read cpu power usage from AMD ryzen cpus on linux
Documentation
  • Coverage
  • 21.43%
    3 out of 14 items documented0 out of 7 items with examples
  • Size
  • Source code size: 28.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.93 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • icewind1991/ryzen-reader
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • icewind1991

ryzer-reader

Read cpu power usage from AMD ryzen cpus on linux

Example

use ryzen_reader::{CpuInfo, Error};

fn main() -> Result<(), Error> {
    let cpu = CpuInfo::new()?;
    let power = cpu.read()?;

    println!("Package power:");
    for (package, usage) in power.packages().enumerate() {
        println!("\t#{}: {:.2}W", package, usage);
    }
    println!("Core power:");
    for (core, usage) in power.cores().enumerate() {
        println!("\t#{}: {:.2}W", core, usage);
    }
    Ok(())
}

Credits

This code is largely based on rapl-read-ryzen and all credits on how to read the values goes to it's author.