Skip to main content

CpuDevice

Struct CpuDevice 

Source
pub struct CpuDevice { /* private fields */ }
Expand description

CPU compute device using sysinfo

Implementations§

Source§

impl CpuDevice

Source

pub fn new() -> Self

Create a new CPU device monitor

Trait Implementations§

Source§

impl ComputeDevice for CpuDevice

Source§

fn device_id(&self) -> DeviceId

Get the unique device identifier
Source§

fn device_name(&self) -> &str

Get the device name (e.g., “NVIDIA GeForce RTX 4090”)
Source§

fn device_type(&self) -> DeviceType

Get the device type
Source§

fn compute_utilization(&self) -> Result<f64, GpuError>

Get compute utilization (0.0-100.0%)
Source§

fn compute_clock_mhz(&self) -> Result<u32, GpuError>

Get compute clock speed in MHz
Source§

fn compute_temperature_c(&self) -> Result<f64, GpuError>

Get compute temperature in Celsius
Source§

fn compute_power_watts(&self) -> Result<f64, GpuError>

Get current power consumption in Watts
Source§

fn compute_power_limit_watts(&self) -> Result<f64, GpuError>

Get power limit in Watts
Source§

fn memory_used_bytes(&self) -> Result<u64, GpuError>

Get used memory in bytes
Source§

fn memory_total_bytes(&self) -> Result<u64, GpuError>

Get total memory in bytes
Source§

fn memory_bandwidth_gbps(&self) -> Result<f64, GpuError>

Get memory bandwidth in GB/s (if available)
Source§

fn compute_unit_count(&self) -> u32

Get number of compute units (SMs for NVIDIA, CUs for AMD, cores for CPU)
Source§

fn active_compute_units(&self) -> Result<u32, GpuError>

Get number of active compute units
Source§

fn pcie_tx_bytes_per_sec(&self) -> Result<u64, GpuError>

Get PCIe TX bytes per second (GPU only)
Source§

fn pcie_rx_bytes_per_sec(&self) -> Result<u64, GpuError>

Get PCIe RX bytes per second (GPU only)
Source§

fn pcie_generation(&self) -> u8

Get PCIe generation (1, 2, 3, 4, 5)
Source§

fn pcie_width(&self) -> u8

Get PCIe width (x1, x4, x8, x16)
Source§

fn refresh(&mut self) -> Result<(), GpuError>

Refresh metrics from hardware
Source§

fn memory_usage_percent(&self) -> Result<f64, GpuError>

Get memory usage percentage (0.0-100.0)
Source§

fn memory_available_bytes(&self) -> Result<u64, GpuError>

Get available memory in bytes
Source§

fn memory_used_mb(&self) -> Result<u64, GpuError>

Get memory used in MB
Source§

fn memory_total_mb(&self) -> Result<u64, GpuError>

Get memory total in MB
Source§

fn memory_total_gb(&self) -> Result<f64, GpuError>

Get memory total in GB
Source§

fn power_usage_percent(&self) -> Result<f64, GpuError>

Get power usage percentage (current/limit * 100)
Source§

fn is_thermal_throttling(&self) -> Result<bool, GpuError>

Check if device is throttling due to temperature
Source§

fn is_power_throttling(&self) -> Result<bool, GpuError>

Check if device is throttling due to power
Source§

impl Debug for CpuDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CpuDevice

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.