From 57ae6119b52ffcba04a8562b6bd785cd4c4399e4 Mon Sep 17 00:00:00 2001 From: Ahmet Salih Date: Wed, 2 Aug 2023 18:28:48 +0300 Subject: [PATCH] AIX: add additional HostMemoryInfo metrics (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For AIX 7.2, the perfstat_memory_total interface includes additional metrics. This change adds those metrics to `types.HostMemoryInfo.Metrics` in the AIX provider. The new attributes being added are: - bytes_coalesced - Number of bytes of the calling partition’s logical real memory coalesced - bytes_coalesced_mempool - Number of bytes of logical real memory coalesced in the calling partition’s memory pool if the calling partition is authorized to see pool wide statistics else, set to zero. - real_pinned - Amount of pinned memory in bytes. - pgins - Number of pages paged in . - pgouts - Number of pages paged out. - pgsp_free - Amount of free paging space in bytes. - pgsp_rsvd - Amount of reserved paging space in bytes. Reference: https://www.ibm.com/docs/en/aix/7.2?topic=interfaces-perfstat-memory-total-interface --------- Co-authored-by: Ahmet SALIH --- .changelog/188.txt | 3 +++ providers/aix/host_aix_ppc64.go | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changelog/188.txt diff --git a/.changelog/188.txt b/.changelog/188.txt new file mode 100644 index 00000000..eff195b0 --- /dev/null +++ b/.changelog/188.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +aix: Added mappings for AIX host memory information +``` diff --git a/providers/aix/host_aix_ppc64.go b/providers/aix/host_aix_ppc64.go index 4f962caa..ea62d205 100644 --- a/providers/aix/host_aix_ppc64.go +++ b/providers/aix/host_aix_ppc64.go @@ -115,6 +115,16 @@ func (*host) Memory() (*types.HostMemoryInfo, error) { mem.VirtualFree = mem.Free + uint64(meminfo.pgsp_free)*pagesize mem.VirtualUsed = mem.VirtualTotal - mem.VirtualFree + mem.Metrics = map[string]uint64{ + "bytes_coalesced": uint64(meminfo.bytes_coalesced), + "bytes_coalesced_mempool": uint64(meminfo.bytes_coalesced_mempool), + "real_pinned": uint64(meminfo.real_pinned) * pagesize, + "pgins": uint64(meminfo.pgins), + "pgouts": uint64(meminfo.pgouts), + "pgsp_free": uint64(meminfo.pgsp_free) * pagesize, + "pgsp_rsvd": uint64(meminfo.pgsp_rsvd) * pagesize, + } + return &mem, nil }