Struct scaphandre::sensors::CPUSocket [−][src]
pub struct CPUSocket {
pub id: u16,
pub domains: Vec<Domain>,
pub attributes: Vec<Vec<HashMap<String, String>>>,
pub counter_uj_path: String,
pub record_buffer: Vec<Record>,
pub buffer_max_kbytes: u16,
pub cpu_cores: Vec<CPUCore>,
pub stat_buffer: Vec<CPUStat>,
}
Expand description
CPUSocket struct represents a CPU socket (matches physical_id attribute in /proc/cpuinfo), owning CPU cores (processor in /proc/cpuinfo).
Fields
id: u16
Numerical ID of the CPU socket (physical_id in /proc/cpuinfo)
domains: Vec<Domain>
RAPL domains attached to the socket
attributes: Vec<Vec<HashMap<String, String>>>
Text attributes linked to that socket, found in /proc/cpuinfo
counter_uj_path: String
Path to the file that provides the counter for energy consumed by the socket, in microjoules.
record_buffer: Vec<Record>
Comsumption records measured and stored by scaphandre for this socket.
buffer_max_kbytes: u16
Maximum size of the record_buffer in kilobytes.
cpu_cores: Vec<CPUCore>
CPU cores (core_id in /proc/cpuinfo) attached to the socket.
stat_buffer: Vec<CPUStat>
Usage statistics records stored for this socket.
Implementations
Returns the content of the energy consumption counter file, as a String value of microjoules.
Returns a mutable reference to the domains vector.
Returns a immutable reference to the domains vector.
Returns a mutable reference to the CPU cores vector.
Returns a immutable reference to the CPU cores vector.
Adds a CPU core instance to the cores vector.
Generates a new CPUStat object storing current usage statistics of the socket and stores it in the stat_buffer.
Combines stats from all CPU cores owned byu the socket and returns a CpuTime struct containing stats for the whole socket.
Computes the difference between previous usage statistics record for the socket and the current one. Returns a CPUStat object containing this difference, field by field.
Returns a Record instance containing the power consumed between last and previous measurement, for this CPU socket
Trait Implementations
Generates a new record of the socket energy consumption and stores it in the record_buffer. Returns a clone of this Record instance.
Checks the size in memory of record_buffer and deletes as many Record instances from the buffer to make it smaller in memory than buffer_max_kbytes.
Returns a new owned Vector being a clone of the current record_buffer. This does not affect the current buffer but is costly.
Auto Trait Implementations
impl RefUnwindSafe for CPUSocket
impl UnwindSafe for CPUSocket
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more