Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Include memory reclaimable from slab as free. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mon-put-instance-data.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
--auto-scaling[=only] Reports Auto Scaling metrics in addition to instance metrics.
If =only is specified, does not report individual instance metrics

--mem-used-incl-cache-buff Count memory that is cached and in buffers as used.
--mem-used-incl-cache-buff Count filsystem cache, buffers, and reclaimable slab memory as used.
--memory-units=UNITS Specifies units for memory metrics.
--disk-space-units=UNITS Specifies units for disk space metrics.

Expand Down Expand Up @@ -520,9 +520,10 @@ sub add_metric
my $mem_free = $meminfo{'MemFree'} * KILO;
my $mem_cached = $meminfo{'Cached'} * KILO;
my $mem_buffers = $meminfo{'Buffers'} * KILO;
my $mem_slab_reclaimable = $meminfo{'SReclaimable'} * KILO;
my $mem_avail = $mem_free;
if (!defined($mem_used_incl_cache_buff)) {
$mem_avail += $mem_cached + $mem_buffers;
$mem_avail += $mem_cached + $mem_buffers + $mem_slab_reclaimable;
}
my $mem_used = $mem_total - $mem_avail;
my $swap_total = $meminfo{'SwapTotal'} * KILO;
Expand Down