Add SReclaimable and SUnreclaim to mem input (#6716)

This commit is contained in:
Daniel Nelson 2019-11-25 15:31:22 -08:00 committed by GitHub
parent 6d94798fd6
commit cbe7d33bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -144,7 +144,7 @@
[[constraint]] [[constraint]]
name = "github.com/shirou/gopsutil" name = "github.com/shirou/gopsutil"
version = "2.18.12" version = "2.19.7"
[[constraint]] [[constraint]]
name = "github.com/Shopify/sarama" name = "github.com/Shopify/sarama"

View File

@ -43,6 +43,8 @@ Available fields are dependent on platform.
- mapped (integer) - mapped (integer)
- page_tables (integer) - page_tables (integer)
- shared (integer) - shared (integer)
- sreclaimable (integer)
- sunreclaim (integer)
- swap_cached (integer) - swap_cached (integer)
- swap_free (integer) - swap_free (integer)
- swap_total (integer) - swap_total (integer)
@ -54,5 +56,5 @@ Available fields are dependent on platform.
### Example Output: ### Example Output:
``` ```
mem active=11347566592i,available=18705133568i,available_percent=89.4288960571006,buffered=1976709120i,cached=13975572480i,commit_limit=14753067008i,committed_as=2872422400i,dirty=87461888i,free=1352400896i,high_free=0i,high_total=0i,huge_page_size=2097152i,huge_pages_free=0i,huge_pages_total=0i,inactive=6201593856i,low_free=0i,low_total=0i,mapped=310427648i,page_tables=14397440i,shared=200781824i,slab=1937526784i,swap_cached=0i,swap_free=4294963200i,swap_total=4294963200i,total=20916207616i,used=3611525120i,used_percent=17.26663449848977,vmalloc_chunk=0i,vmalloc_total=35184372087808i,vmalloc_used=0i,wired=0i,write_back=0i,write_back_tmp=0i 1536704085000000000 mem active=9299595264i,available=16818249728i,available_percent=80.41654254645131,buffered=2383761408i,cached=13316689920i,commit_limit=14751920128i,committed_as=11781156864i,dirty=122880i,free=1877688320i,high_free=0i,high_total=0i,huge_page_size=2097152i,huge_pages_free=0i,huge_pages_total=0i,inactive=7549939712i,low_free=0i,low_total=0i,mapped=416763904i,page_tables=19787776i,shared=670679040i,slab=2081071104i,sreclaimable=1923395584i,sunreclaim=157675520i,swap_cached=1302528i,swap_free=4286128128i,swap_total=4294963200i,total=20913917952i,used=3335778304i,used_percent=15.95004011996231,vmalloc_chunk=0i,vmalloc_total=35184372087808i,vmalloc_used=0i,wired=0i,write_back=0i,write_back_tmp=0i 1574712869000000000
``` ```

View File

@ -50,6 +50,8 @@ func (s *MemStats) Gather(acc telegraf.Accumulator) error {
"mapped": vm.Mapped, "mapped": vm.Mapped,
"page_tables": vm.PageTables, "page_tables": vm.PageTables,
"shared": vm.Shared, "shared": vm.Shared,
"sreclaimable": vm.SReclaimable,
"sunreclaim": vm.SUnreclaim,
"swap_cached": vm.SwapCached, "swap_cached": vm.SwapCached,
"swap_free": vm.SwapFree, "swap_free": vm.SwapFree,
"swap_total": vm.SwapTotal, "swap_total": vm.SwapTotal,

View File

@ -40,6 +40,8 @@ func TestMemStats(t *testing.T) {
Mapped: 42236, Mapped: 42236,
PageTables: 1236, PageTables: 1236,
Shared: 0, Shared: 0,
SReclaimable: 1923022848,
SUnreclaim: 157728768,
SwapCached: 0, SwapCached: 0,
SwapFree: 524280, SwapFree: 524280,
SwapTotal: 524280, SwapTotal: 524280,
@ -81,6 +83,8 @@ func TestMemStats(t *testing.T) {
"mapped": uint64(42236), "mapped": uint64(42236),
"page_tables": uint64(1236), "page_tables": uint64(1236),
"shared": uint64(0), "shared": uint64(0),
"sreclaimable": uint64(1923022848),
"sunreclaim": uint64(157728768),
"swap_cached": uint64(0), "swap_cached": uint64(0),
"swap_free": uint64(524280), "swap_free": uint64(524280),
"swap_total": uint64(524280), "swap_total": uint64(524280),