Skip to content

Commit

Permalink
bug: display arc max size in arc usage instead of system memory
Browse files Browse the repository at this point in the history
  • Loading branch information
zebp committed Jul 24, 2023
1 parent dbf0545 commit 506ebbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/data_harvester/memory/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) fn get_arc_usage() -> Option<MemHarvest> {
if let Some((label, value)) = line.split_once(' ') {
let to_write = match label {
"size" => &mut mem_arc,
"memory_all_bytes" => &mut mem_total,
"c_max" => &mut mem_total,
_ => {
continue;
}
Expand All @@ -45,7 +45,7 @@ pub(crate) fn get_arc_usage() -> Option<MemHarvest> {
use sysctl::Sysctl;
if let (Ok(mem_arc_value), Ok(mem_sys_value)) = (
sysctl::Ctl::new("kstat.zfs.misc.arcstats.size"),
sysctl::Ctl::new("hw.physmem"),
sysctl::Ctl::new("kstat.zfs.misc.arcstats.c_max"),
) {
if let (Ok(sysctl::CtlValue::U64(arc)), Ok(sysctl::CtlValue::Ulong(mem))) =
(mem_arc_value.value(), mem_sys_value.value())
Expand Down

0 comments on commit 506ebbb

Please sign in to comment.