From 26d9d53e74b57bb2340f5eb6d52884653e9b164a Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 24 Jul 2019 18:23:17 +0900 Subject: [PATCH] remove memory.active and inactive metrics --- metrics/darwin/memory.go | 4 +--- metrics/darwin/memory_test.go | 2 -- metrics/freebsd/memory.go | 8 -------- metrics/freebsd/memory_test.go | 2 -- metrics/linux/memory.go | 4 +--- metrics/linux/memory_test.go | 2 -- 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/metrics/darwin/memory.go b/metrics/darwin/memory.go index 784fb1000..a29036c74 100644 --- a/metrics/darwin/memory.go +++ b/metrics/darwin/memory.go @@ -13,7 +13,7 @@ MemoryGenerator collect memory usage `memory.{metric}`: using memory size retrieved from `vm_stat` -metric = "total", "free", "used", "cached", "active", "inactive" +metric = "total", "free", "used", "cached" graph: stacks `memory.{metric}` */ @@ -34,8 +34,6 @@ func (g *MemoryGenerator) Generate() (metrics.Values, error) { "memory.used": float64(memory.Used), "memory.cached": float64(memory.Cached), "memory.free": float64(memory.Free), - "memory.active": float64(memory.Active), - "memory.inactive": float64(memory.Inactive), "memory.swap_total": float64(memory.SwapTotal), "memory.swap_free": float64(memory.SwapFree), } diff --git a/metrics/darwin/memory_test.go b/metrics/darwin/memory_test.go index 973f48d6e..457de3d7a 100644 --- a/metrics/darwin/memory_test.go +++ b/metrics/darwin/memory_test.go @@ -16,8 +16,6 @@ func TestMemoryGenerator(t *testing.T) { "total", "free", "cached", - "active", - "inactive", "used", "swap_total", "swap_free", diff --git a/metrics/freebsd/memory.go b/metrics/freebsd/memory.go index 5dbfc38d2..99efbe5d3 100644 --- a/metrics/freebsd/memory.go +++ b/metrics/freebsd/memory.go @@ -47,14 +47,6 @@ func (g *MemoryGenerator) Generate() (metrics.Values, error) { k = k[0 : len(k)-1] } switch k { - case "Active": - ret["memory.active"] = v - case "Inact": - ret["memory.inactive"] = v - /* - case "Wired": - ret["memory.wired"] = v - */ case "Cache": ret["memory.cached"] = v case "Buf": diff --git a/metrics/freebsd/memory_test.go b/metrics/freebsd/memory_test.go index c7108a882..949e42766 100644 --- a/metrics/freebsd/memory_test.go +++ b/metrics/freebsd/memory_test.go @@ -18,8 +18,6 @@ func TestMemoryGenerator(t *testing.T) { "free", "buffers", "cached", - "active", - "inactive", "swap_total", "swap_free", } { diff --git a/metrics/linux/memory.go b/metrics/linux/memory.go index cd03a56d3..06a0890ca 100644 --- a/metrics/linux/memory.go +++ b/metrics/linux/memory.go @@ -13,7 +13,7 @@ MemoryGenerator collect memory usage `memory.{metric}`: using memory size[KiB] retrieved from /proc/meminfo -metric = "total", "free", "buffers", "cached", "active", "inactive", "swap_cached", "swap_total", "swap_free" +metric = "total", "free", "buffers", "cached", "swap_cached", "swap_total", "swap_free" Metrics "used" is calculated by (total - available) when MemAvailable is available in /proc/meminfo and @@ -37,8 +37,6 @@ func (g *MemoryGenerator) Generate() (metrics.Values, error) { ret := map[string]float64{ "memory.total": float64(mem.Total), "memory.used": float64(mem.Used), - "memory.active": float64(mem.Active), - "memory.inactive": float64(mem.Inactive), "memory.swap_total": float64(mem.SwapTotal), "memory.swap_cached": float64(mem.SwapCached), "memory.swap_free": float64(mem.SwapFree), diff --git a/metrics/linux/memory_test.go b/metrics/linux/memory_test.go index 9f3836922..064f46aae 100644 --- a/metrics/linux/memory_test.go +++ b/metrics/linux/memory_test.go @@ -17,8 +17,6 @@ func TestMemoryGenerator(t *testing.T) { metricNames := []string{ "total", "mem_available", - "active", - "inactive", "swap_cached", "swap_total", "swap_free",