Skip to main content

CpuManager

Trait CpuManager 

Source
pub trait CpuManager {
    // Required methods
    fn device_count() -> Result<usize, ZeusdError>;
    fn get_available_fields(
        index: usize,
    ) -> Result<(Arc<PackageInfo>, Option<Arc<PackageInfo>>), ZeusdError>;
    fn get_cpu_energy(&mut self) -> Result<u64, ZeusdError>;
    fn get_dram_energy(&mut self) -> Result<u64, ZeusdError>;
    fn is_dram_available(&self) -> bool;
}

Required Methods§

Source

fn device_count() -> Result<usize, ZeusdError>

Get the number of CPUs available.

Source

fn get_available_fields( index: usize, ) -> Result<(Arc<PackageInfo>, Option<Arc<PackageInfo>>), ZeusdError>

Get the CPU PackageInfo and the DRAM PackageInfo it is available.

Source

fn get_cpu_energy(&mut self) -> Result<u64, ZeusdError>

Get the cumulative energy counter value of the CPU after compensating for wraparounds.

Source

fn get_dram_energy(&mut self) -> Result<u64, ZeusdError>

Get the cumulative energy counter value of the DRAM after compensating for wraparounds.

Source

fn is_dram_available(&self) -> bool

Check if DRAM is available.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§