Skip to content

Commit

Permalink
src: linux: system: Add governor function
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Sep 3, 2023
1 parent 6ed3153 commit 6e0479f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/linux/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use crate::sys::cpu::*;
use crate::sys::process::*;
use crate::sys::utils::{get_all_data, to_u64};
use crate::{
CpuRefreshKind, Disks, LoadAvg, Networks, Pid, ProcessRefreshKind, RefreshKind, SystemExt, User,
CpuRefreshKind, Disks, GovernorKind, LoadAvg, Networks, Pid, ProcessRefreshKind, RefreshKind,
SystemExt, User,
};

use libc::{self, c_char, c_int, sysconf, _SC_CLK_TCK, _SC_HOST_NAME_MAX, _SC_PAGESIZE};
Expand Down Expand Up @@ -402,6 +403,10 @@ impl SystemExt for System {
&self.cpus.global_cpu
}

fn governor(&self) -> GovernorKind {
get_governor().unwrap_or_default()
}

fn cpus(&self) -> &[Cpu] {
&self.cpus.cpus
}
Expand Down

0 comments on commit 6e0479f

Please sign in to comment.