HostCpu

Struct HostCpu 

Source
pub struct HostCpu {
Show 17 fields pub load_one: u32, pub load_five: u32, pub load_fifteen: u32, pub proc_run: u32, pub proc_total: u32, pub cpu_num: u32, pub cpu_speed: u32, pub uptime: u32, pub cpu_user: u32, pub cpu_nice: u32, pub cpu_system: u32, pub cpu_idle: u32, pub cpu_wio: u32, pub cpu_intr: u32, pub cpu_sintr: u32, pub interrupts: u32, pub contexts: u32,
}
Expand description

Host CPU - Format (0,2003)

Physical server CPU statistics

§XDR Definition (sFlow Host)

/* Physical Server CPU */
/* opaque = counter_data; enterprise = 0; format = 2003 */

struct host_cpu {
    float load_one;          /* 1 minute load avg */
    float load_five;         /* 5 minute load avg */
    float load_fifteen;      /* 15 minute load avg */
    unsigned int proc_run;   /* running processes */
    unsigned int proc_total; /* total processes */
    unsigned int cpu_num;    /* number of CPUs */
    unsigned int cpu_speed;  /* CPU speed in MHz */
    unsigned int uptime;     /* seconds since last reboot */
    unsigned int cpu_user;   /* user time (ms) */
    unsigned int cpu_nice;   /* nice time (ms) */
    unsigned int cpu_system; /* system time (ms) */
    unsigned int cpu_idle;   /* idle time (ms) */
    unsigned int cpu_wio;    /* I/O wait time (ms) */
    unsigned int cpu_intr;   /* interrupt time (ms) */
    unsigned int cpu_sintr;  /* soft interrupt time (ms) */
    unsigned int interrupts; /* interrupt count */
    unsigned int contexts;   /* context switch count */
}

Fields§

§load_one: u32

Load average (1 minute) - stored as hundredths (multiply by 100)

§load_five: u32

Load average (5 minutes) - stored as hundredths (multiply by 100)

§load_fifteen: u32

Load average (15 minutes) - stored as hundredths (multiply by 100)

§proc_run: u32

Number of running processes

§proc_total: u32

Total number of processes

§cpu_num: u32

Number of CPUs

§cpu_speed: u32

CPU speed in MHz

§uptime: u32

CPU uptime in seconds

§cpu_user: u32

CPU time in user mode (ms)

§cpu_nice: u32

CPU time in nice mode (ms)

§cpu_system: u32

CPU time in system mode (ms)

§cpu_idle: u32

CPU idle time (ms)

§cpu_wio: u32

CPU time waiting for I/O (ms)

§cpu_intr: u32

CPU time servicing interrupts (ms)

§cpu_sintr: u32

CPU time servicing soft interrupts (ms)

§interrupts: u32

Number of interrupts

§contexts: u32

Number of context switches

Trait Implementations§

Source§

impl Clone for HostCpu

Source§

fn clone(&self) -> HostCpu

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HostCpu

Source§

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

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

impl PartialEq for HostCpu

Source§

fn eq(&self, other: &HostCpu) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for HostCpu

Source§

impl StructuralPartialEq for HostCpu

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.