Skip to content

Commit 8af3775

Browse files
committed
store a new trace before exit
1 parent f8a9fc7 commit 8af3775

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nipype/utils/profiler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @Author: oesteban
33
# @Date: 2017-09-21 15:50:37
44
# @Last Modified by: oesteban
5-
# @Last Modified time: 2017-09-26 15:05:24
5+
# @Last Modified time: 2017-09-27 12:57:50
66
"""
77
Utilities to keep track of performance
88
"""
@@ -53,6 +53,10 @@ def stop(self):
5353
if not self._event.is_set():
5454
self._event.set()
5555
self.join()
56+
ram = _get_ram_mb(self._pid) or 0
57+
cpus = _get_num_threads(self._pid) or 0
58+
print('%s,%f,%d' % (time(), ram, cpus),
59+
file=self._log)
5660
self._log.flush()
5761
self._log.close()
5862

0 commit comments

Comments
 (0)