sensu-plugins-process-checks 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09b733d6bdedcd78d3eb5d607b8efd1ca58e67ec
4
- data.tar.gz: 1efa3e75c4a73b034eaf991b8bd0456b93050f63
3
+ metadata.gz: 1aab223267b895dbbbce38685a4928b1801d03a8
4
+ data.tar.gz: 7a45deb3970294cc3f8acaff0c74d8ccda4f9743
5
5
  SHA512:
6
- metadata.gz: 8addda414b9a6c4fa6eab9df192cbdf3aee9094c737a0f8a4b83e39caa435ec71c00888234425e633a3a427564fd46859b65f1d7c92eee4f36fb227db7659803
7
- data.tar.gz: 6cfd6704429d9c5ac42c9a1e88db52508bf1ff881c62e2778753839fcdb7262bcad851d8ea1f1ba077b18088e033f5ef657b4d6e624af9f2fada17b0cd5c7059
6
+ metadata.gz: c9aeaa218f5a55fd0d6aaee1560af7b68d444dbbc0af440f00a55f77afd2a0beed3d0f87368196b71119d98c6ed1be76aadc4f81a730ac50240dfc2ca65278dc
7
+ data.tar.gz: 9ae11bfe35a884d635ed38973469b4e3d7a22f7b0277be5fa0c436a5622b0cb6627fc96d02bc9e90a737845698f1dbf04b0ea5d040fdef22dbe0b6fe5609a821
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+ ## [2.3.0] - 2017-05-29
8
+ ### Changed
9
+ - metrics-per-process.py: Use memory_info() in psutil versions greater than 4.0.0, as memory_info_ex() was deprecated.
10
+
7
11
  ## [2.2.0] - 2017-05-28
8
12
  ### Changed
9
13
  - metrics-per-process.py: Fallback to importing Counter from backport_collections for Python 2.6 support.
@@ -122,7 +126,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
122
126
  - built against 1.9.3, 2.0, 2.1
123
127
  - cryptographically signed
124
128
 
125
- [unreleased]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.2.0...HEAD
129
+ [unreleased]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.3.0...HEAD
130
+ [2.3.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.2.0...2.3.0
126
131
  [2.2.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.1.0...2.2.0
127
132
  [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.0.0...2.1.0
128
133
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/1.0.0...2.0.0
@@ -114,17 +114,21 @@ def stats_per_pid(pid):
114
114
 
115
115
  stats = {}
116
116
  process_handler = psutil.Process(pid)
117
+ if psutil.version_info < (4,0,0):
118
+ process_memory_info = process_handler.memory_info_ex()
119
+ else:
120
+ process_memory_info = process_handler.memory_info()
117
121
  stats['cpu.user'] = process_handler.cpu_times().user
118
122
  stats['cpu.system'] = process_handler.cpu_times().system
119
123
  stats['cpu.percent'] = process_handler.cpu_percent()
120
124
  stats['threads'] = process_handler.num_threads()
121
- stats['memory.rss'] = process_handler.memory_info_ex().rss
122
- stats['memory.vms'] = process_handler.memory_info_ex().vms
123
- stats['memory.shared'] = process_handler.memory_info_ex().shared
124
- stats['memory.text'] = process_handler.memory_info_ex().text
125
- stats['memory.lib'] = process_handler.memory_info_ex().lib
126
- stats['memory.data'] = process_handler.memory_info_ex().data
127
- stats['memory.dirty'] = process_handler.memory_info_ex().dirty
125
+ stats['memory.rss'] = process_memory_info.rss
126
+ stats['memory.vms'] = process_memory_info.vms
127
+ stats['memory.shared'] = process_memory_info.shared
128
+ stats['memory.text'] = process_memory_info.text
129
+ stats['memory.lib'] = process_memory_info.lib
130
+ stats['memory.data'] = process_memory_info.data
131
+ stats['memory.dirty'] = process_memory_info.dirty
128
132
  stats['memory.percent'] = process_handler.memory_percent()
129
133
  stats['fds'] = process_handler.num_fds()
130
134
  stats['ctx_switches.voluntary'] = process_handler.num_ctx_switches().voluntary
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsProcessChecks
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 2
4
+ MINOR = 3
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-process-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors