Skip to content

Commit 815e015

Browse files
echarlesCarreau
authored andcommitted
only return the memory usage as a dict
1 parent 95a65d5 commit 815e015

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ipykernel/kernelbase.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,7 @@ async def usage_request(self, stream, ident, parent):
872872
# The first time cpu_percent is called it will return a meaningless 0.0 value which you are supposed to ignore.
873873
if cpu_percent != None and cpu_percent != 0.0:
874874
reply_content['cpu_percent'] = cpu_percent
875-
reply_content['virtual_memory'] = psutil.virtual_memory()
876-
reply_content['virtual_memory_dict'] = dict(psutil.virtual_memory()._asdict())
877-
reply_content['virtual_memory_percent'] = psutil.virtual_memory().percent
878-
reply_content['available_memory_percentage'] = psutil.virtual_memory().available * 100 / psutil.virtual_memory().total
875+
reply_content['virtual_memory'] = dict(psutil.virtual_memory()._asdict())
879876
reply_msg = self.session.send(stream, 'usage_reply', reply_content,
880877
parent, ident)
881878
self.log.debug("%s", reply_msg)

0 commit comments

Comments
 (0)