Skip to content

Commit

Permalink
AIX: add additional HostMemoryInfo metrics (#188)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
asalih and Ahmet SALIH authored Aug 2, 2023
1 parent 66ecab8 commit 57ae611
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/188.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
aix: Added mappings for AIX host memory information
```
10 changes: 10 additions & 0 deletions providers/aix/host_aix_ppc64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 57ae611

Please sign in to comment.