Skip to content

Commit 51c8f5e

Browse files
committed
Add the PID to the resource usage reply
1 parent 7717f2c commit 51c8f5e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ipykernel/kernelbase.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,10 @@ def get_process_metric_value(self, process, name, attribute=None):
929929
return None
930930

931931
async def usage_request(self, stream, ident, parent):
932-
reply_content = {"hostname": socket.gethostname()}
932+
reply_content = {
933+
"hostname": socket.gethostname(),
934+
"pid": os.getpid()
935+
}
933936
current_process = psutil.Process()
934937
all_processes = [current_process] + current_process.children(recursive=True)
935938
process_metric_value = self.get_process_metric_value

0 commit comments

Comments
 (0)