pub fn new(
        buffer_per_socket_max_kbytes: u16,
        buffer_per_domain_max_kbytes: u16,
        virtual_machine: bool,
    ) -> PowercapRAPLSensor {
        let mut powercap_path = String::from("/sys/class/powercap");
        if virtual_machine {
            powercap_path = String::from("/var/scaphandre");
            if let Ok(val) = env::var("SCAPHANDRE_POWERCAP_PATH") {
                powercap_path = val;
            }

            warn!("Powercap_rapl path is: {}", powercap_path);
        }

        PowercapRAPLSensor {
            base_path: powercap_path,
            buffer_per_socket_max_kbytes,
            buffer_per_domain_max_kbytes,
            virtual_machine,
        }
    }
/// Instantiates and returns an instance of PowercapRAPLSensor.
Instantiates and returns an instance of PowercapRAPLSensor.
Instantiates and returns an instance of PowercapRAPLSensor .
pub fn new(
        buffer_per_socket_max_kbytes: u16,
        buffer_per_domain_max_kbytes: u16,
        virtual_machine: bool,
    ) -> PowercapRAPLSensor {
        let mut powercap_path = String::from("/sys/class/powercap");
        if virtual_machine {
            powercap_path = String::from("/var/scaphandre");
            if let Ok(val) = env::var("SCAPHANDRE_POWERCAP_PATH") {
                powercap_path = val;
            }
            warn!("Powercap_rapl path is: {}", powercap_path);
        }
        PowercapRAPLSensor {
            base_path: powercap_path,
            buffer_per_socket_max_kbytes,
            buffer_per_domain_max_kbytes,
            virtual_machine,
        }
    }
pub fn new ( buffer_per_socket_max_kbytes : u16 , buffer_per_domain_max_kbytes : u16 , virtual_machine : bool , ) -> PowercapRAPLSensor { let mut powercap_path = String :: from ( " " ) ; if virtual_machine { powercap_path = String :: from ( " " ) ; if let Ok ( val ) = env :: var ( " " ) { powercap_path = val ; } warn ! ( " " powercap_path ) ; } PowercapRAPLSensor { base_path : powercap_path , buffer_per_socket_max_kbytes , buffer_per_domain_max_kbytes , virtual_machine , } }
Instantiates and returns an instance of PowercapRAPLSensor.
Instantiates and returns an instance of PowercapRAPLSensor .
buffer_per_socket_max_kbytes
u16
buffer_per_domain_max_kbytes
u16
virtual_machine
bool
buffer_per_socket_max_kbytes
u16
buffer_per_domain_max_kbytes
u16
virtual_machine
bool