Merge "Add support for gathering Slab memory usage"

This commit is contained in:
Zuul 2020-01-13 18:00:27 +00:00 committed by Gerrit Code Review
commit 8af052695b
3 changed files with 11 additions and 0 deletions

View File

@ -462,6 +462,7 @@ instances:
| mem.used_cached | | Mbytes of memory used for the page cache
| mem.used_shared | | Mbytes of memory shared between separate processes and typically used for inter-process communication
| mem.used_real_mb | | Mbytes of memory currently in use less mem.used_buffers and mem.used_cached
| mem.used_slab_mb | | Mbytes of memory currently allocated to slab. Requires psutil >=5.4.4.
### Disk
| Metric Name | Dimensions | Semantics |

View File

@ -97,4 +97,11 @@ class Memory(checks.AgentCheck):
dimensions=dimensions)
count += 1
# The slab metric was added in psutil 5.4.4
if hasattr(mem_info, 'slab') and mem_info.slab:
self.gauge('mem.used_slab_mb',
int(mem_info.slab / 1048576),
dimensions=dimensions)
count += 1
log.debug('Collected {0} memory metrics'.format(count))

View File

@ -0,0 +1,3 @@
---
features:
- Adds support for monitoring slab memory usage.