[Dashboard] Add profiling button to logical view (#6901)

This commit is contained in:
Mitchell Stern
2020-01-24 11:52:14 -08:00
committed by Philipp Moritz
parent 446cbdf2e0
commit 33423627ca
5 changed files with 177 additions and 54 deletions
+14 -12
View File
@@ -190,21 +190,23 @@ def test_raylet_info_endpoint(shutdown_only):
"node_id": ray.nodes()[0]["NodeID"],
"pid": actor_pid,
"duration": 5
}).json()
}).json()["result"]
start_time = time.time()
while True:
time.sleep(1)
try:
profiling_info = requests.get(
webui_url + "/api/check_profiling_status",
params={
"profiling_id": profiling_id,
}).json()
assert profiling_info["status"] in ("finished", "pending", "error")
# Sometimes some startup time is required
if time.time() - start_time > 30:
raise RayTestTimeoutException(
"Timed out while collecting profiling stats.")
profiling_info = requests.get(
webui_url + "/api/check_profiling_status",
params={
"profiling_id": profiling_id,
}).json()
status = profiling_info["result"]["status"]
assert status in ("finished", "pending", "error")
if status in ("finished", "error"):
break
except AssertionError:
if time.time() - start_time + 10:
raise Exception("Timed out while collecting profiling stats.")
time.sleep(1)
def test_profiling_info_endpoint(shutdown_only):