File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040import sys
4141import time
4242from io import open
43- from subprocess import check_output
4443
4544from psutil import Process
4645import zmq
5150
5251# TODO: Refactor this so that there's a class that stores socket, since creating
5352# a new one each time is hugely wasteful.
54-
5553def _send_zmq_msg (job_id , command , data , address ):
5654 """
5755 simple code to send messages back to host
@@ -107,7 +105,7 @@ def get_memory_usage(pid):
107105 """
108106
109107 p = Process (pid )
110- return p .get_memory_usage ()[0 ] / (1024.0 ** 2.0 )
108+ return float ( p .get_memory_usage ()[0 ]) / (1024.0 ** 2.0 )
111109
112110
113111def get_cpu_load (pid ):
@@ -121,7 +119,7 @@ def get_cpu_load(pid):
121119 """
122120
123121 p = Process (pid )
124- return p .get_cpu_percent (), p .status
122+ return float ( p .get_cpu_percent () ), p .status
125123
126124
127125def get_job_status (parent_pid ):
You can’t perform that action at this time.
0 commit comments