Take a Chrome tracing timeline for a Ray cluster.
(address)
| 2262 | help="Override the Ray address to connect to.", |
| 2263 | ) |
| 2264 | def timeline(address): |
| 2265 | """Take a Chrome tracing timeline for a Ray cluster.""" |
| 2266 | address = services.canonicalize_bootstrap_address_or_die(address) |
| 2267 | logger.info(f"Connecting to Ray instance at {address}.") |
| 2268 | ray.init(address=address) |
| 2269 | time = datetime.today().strftime("%Y-%m-%d_%H-%M-%S") |
| 2270 | filename = os.path.join( |
| 2271 | ray.get_runtime_context().get_temp_dir(), f"ray-timeline-{time}.json" |
| 2272 | ) |
| 2273 | ray.timeline(filename=filename) |
| 2274 | logger.info(f"Trace file written to {filename} in the ray temp directory.") |
| 2275 | logger.info("You can open this with chrome://tracing in the Chrome browser.") |
| 2276 | |
| 2277 | |
| 2278 | @cli.command() |
nothing calls this directly
no test coverage detected
searching dependent graphs…