Skip to content

Commit

Permalink
chore(deps): bump sysinfo from 0.32.1 to 0.33.0 (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabetti1720 authored Dec 18, 2024
1 parent b45a2c8 commit 5f937d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/llrt_os/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ llrt_utils = { version = "0.3.0-beta", path = "../../libs/llrt_utils", default-f
num_cpus = "1"
once_cell = "1"
rquickjs = { git = "https://github.com/DelSkayn/rquickjs.git", version = "0.8.1", default-features = false }
sysinfo = { version = "0.32", features = ["system"], default-features = false }
sysinfo = { version = "0.33", features = ["system"], default-features = false }

[target.'cfg(unix)'.dependencies]
libc = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions modules/llrt_os/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ fn get_load_avg() -> Vec<f64> {
vec![load_avg.one, load_avg.five, load_avg.fifteen]
}

fn get_machine(ctx: Ctx<'_>) -> Result<String> {
System::cpu_arch().ok_or_else(|| Exception::throw_reference(&ctx, "System::cpu_arch"))
fn get_machine() -> String {
System::cpu_arch()
}

fn get_tmp_dir() -> String {
Expand Down
10 changes: 5 additions & 5 deletions modules/llrt_os/src/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use sysinfo::{CpuRefreshKind, MemoryRefreshKind, RefreshKind, System};

static SYSTEM: Lazy<Arc<Mutex<System>>> = Lazy::new(|| {
Arc::new(Mutex::new(System::new_with_specifics(
RefreshKind::new()
.with_cpu(CpuRefreshKind::new().with_cpu_usage().with_frequency())
.with_memory(MemoryRefreshKind::new().with_ram()),
RefreshKind::nothing()
.with_cpu(CpuRefreshKind::nothing().with_cpu_usage().with_frequency())
.with_memory(MemoryRefreshKind::nothing().with_ram()),
)))
});

Expand Down Expand Up @@ -40,13 +40,13 @@ pub fn get_cpus(ctx: Ctx<'_>) -> Result<Vec<Object>> {
pub fn get_free_mem() -> u64 {
let mut system = SYSTEM.lock().unwrap();

system.refresh_memory_specifics(MemoryRefreshKind::new().with_ram());
system.refresh_memory_specifics(MemoryRefreshKind::nothing().with_ram());
system.free_memory()
}

pub fn get_total_mem() -> u64 {
let mut system = SYSTEM.lock().unwrap();

system.refresh_memory_specifics(MemoryRefreshKind::new().with_ram());
system.refresh_memory_specifics(MemoryRefreshKind::nothing().with_ram());
system.total_memory()
}

0 comments on commit 5f937d4

Please sign in to comment.