pub struct PowerStats {
pub cpu_package_w: Option<f32>,
pub gpus_w: Option<f32>,
pub igpu_w: Option<f32>,
pub total_w: Option<f32>,
pub battery: Option<BatteryStats>,
}Expand description
Power draw summary.
There is no portable way to measure whole-system power without external hardware, so the total is the sum of the CPU package and discrete GPUs, which dominate consumption on typical workstations.
Fields§
§cpu_package_w: Option<f32>CPU package power (RAPL on Linux). None before the second sample or
when RAPL is unavailable.
gpus_w: Option<f32>Sum of power reported by discrete GPUs.
igpu_w: Option<f32>Power an AMD APU’s graphics driver reports (amdgpu PPT). Per the
kernel documentation it covers the whole SoC, CPU cores included, so
it overlaps the CPU package and only stands in for it when RAPL cannot
be read (see PowerStats::cpu_or_soc_w).
total_w: Option<f32>cpu_package_w (or igpu_w without it) + gpus_w, counting only the
parts that are available.
battery: Option<BatteryStats>Laptop battery, if there is one.
Implementations§
Source§impl PowerStats
impl PowerStats
Sourcepub fn cpu_or_soc_w(&self) -> (&'static str, Option<f32>)
pub fn cpu_or_soc_w(&self) -> (&'static str, Option<f32>)
The CPU figure to show: ("CPU", RAPL), else ("SoC", APU PPT).