Skip to content

Commit 888e7fa

Browse files
authored
fix: bad variable name
1 parent ae27346 commit 888e7fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nipype/utils/profiler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, pid, freq=0.2, fname=None, cwd=None):
5454

5555
# Leave process initialized and make first sample
5656
self._process = psutil.Process(pid)
57-
_sample = self._sample(cpu_interval=0.2)
57+
_first_sample = self._sample(cpu_interval=0.2)
5858

5959
# Continue monitor configuration
6060
freq = max(freq, 0.2)
@@ -66,7 +66,7 @@ def __init__(self, pid, freq=0.2, fname=None, cwd=None):
6666
self._freq = freq
6767

6868
# Dump first sample to file
69-
print(",".join(_sample), file=self._logfile)
69+
print(",".join(_first_sample), file=self._logfile)
7070
self._logfile.flush()
7171

7272
# Start thread
@@ -108,6 +108,7 @@ def stop(self):
108108
return retval
109109

110110
def _sample(self, cpu_interval=None):
111+
_time = time()
111112
cpu = 0.0
112113
rss = 0.0
113114
vms = 0.0
@@ -136,7 +137,7 @@ def _sample(self, cpu_interval=None):
136137
except psutil.NoSuchProcess:
137138
pass
138139

139-
return (time(), cpu, rss / _MB, vms / _MB)
140+
return (_time, cpu, rss / _MB, vms / _MB)
140141

141142
def run(self):
142143
"""Core monitoring function, called by start()"""

0 commit comments

Comments
 (0)