Skip to content

Commit df7d79a

Browse files
refactor: Remove interval arg to cpu_percent
* By removing `interval`, the function returns immediately without blocking Signed-off-by: Mahendra Paipuri <[email protected]>
1 parent cd2d6fa commit df7d79a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_resource_usage/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def get(self):
9595
def _get_cpu_percent(self, all_processes):
9696
def get_cpu_percent(p):
9797
try:
98-
return p.cpu_percent(interval=0.05)
98+
return p.cpu_percent()
9999
# Avoid littering logs with stack traces complaining
100100
# about dead processes having no CPU usage
101101
except:

0 commit comments

Comments
 (0)