Skip to content

Commit cc2212b

Browse files
authored
meminfo: Add Zswap/Zswapped metrics (#3453)
Add metrics for Zswap and Zswapped to the meminfo collector. Fixes: #3449 Signed-off-by: Ben Kochie <[email protected]>
1 parent ef5efb7 commit cc2212b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

collector/meminfo_linux.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ func (c *meminfoCollector) getMemInfo() (map[string]float64, error) {
184184
if meminfo.WritebackTmpBytes != nil {
185185
metrics["WritebackTmp_bytes"] = float64(*meminfo.WritebackTmpBytes)
186186
}
187+
if meminfo.ZswapBytes != nil {
188+
metrics["Zswap_ytes"] = float64(*meminfo.ZswapBytes)
189+
}
190+
if meminfo.ZswappedBytes != nil {
191+
metrics["Zswapped_bytes"] = float64(*meminfo.ZswappedBytes)
192+
}
187193

188194
// These fields are always in bytes and do not have `Bytes`
189195
// suffixed counterparts in the procfs.Meminfo struct, nor do

0 commit comments

Comments
 (0)