[Dashboard] Add initial version of new dashboard (#5730)

This commit is contained in:
Mitchell Stern
2019-09-23 08:50:40 -07:00
committed by Robert Nishihara
parent 56ab9a00bb
commit 98dcc1d440
28 changed files with 14738 additions and 67 deletions
+7 -11
View File
@@ -13,7 +13,7 @@ from socket import AddressFamily
try:
import psutil
except ModuleNotFoundError:
except ImportError:
print("The reporter requires psutil to run.")
import sys
sys.exit(1)
@@ -48,14 +48,8 @@ def jsonify_asdict(o):
return json.dumps(recursive_asdict(o))
def running_worker(s):
if "ray_worker" not in s:
return False
if s == "ray_worker":
return False
return True
def is_worker(cmdline):
return cmdline and cmdline[0].startswith("ray_")
def determine_ip_address():
@@ -127,8 +121,10 @@ class Reporter(object):
def get_workers():
return [
x.as_dict(attrs=[
"pid", "create_time", "cpu_times", "name", "memory_full_info"
]) for x in psutil.process_iter() if running_worker(x.name())
"pid", "create_time", "cpu_percent", "cpu_times", "name",
"cmdline", "memory_info", "memory_full_info"
]) for x in psutil.process_iter(attrs=["cmdline"])
if is_worker(x.info["cmdline"])
]
def get_load_avg(self):