Skip to content

Commit

Permalink
Merge "Add support for gathering Slab memory usage"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Jan 13, 2020
2 parents 3406f82 + 0a4abd5 commit 8af0526
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
7 changes: 7 additions & 0 deletions monasca_agent/collector/checks_d/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@ def check(self, instance):
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))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
features:
- Adds support for monitoring slab memory usage.

0 comments on commit 8af0526

Please sign in to comment.