Skip to content

Commit

Permalink
Merge "Add check for psutil process.get_cpu_times()" into R3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 29, 2017
2 parents 01756f4 + 9c9b767 commit 171e345
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nodemgr/common/cpuinfo.py
Expand Up @@ -112,7 +112,10 @@ def _get_process_cpu_share(self):
last_cpu = self.last_cpu
last_time = self.last_time

current_cpu = self._process.get_cpu_times()
if hasattr(self._process, 'get_cpu_times'):
current_cpu = self._process.get_cpu_times()
else:
current_cpu = self._process.cpu_times()
current_time = os.times()[4]

# tracking system/user time only
Expand Down

0 comments on commit 171e345

Please sign in to comment.