| 338 | return [] |
| 339 | |
| 340 | def timeline(self, filename: Optional[str] = None) -> Optional[List[Any]]: |
| 341 | logger.warning( |
| 342 | "Timeline will include events from other clients using this server." |
| 343 | ) |
| 344 | # This should be imported here, otherwise, it will error doc build. |
| 345 | import ray.core.generated.ray_client_pb2 as ray_client_pb2 |
| 346 | |
| 347 | all_events = self.worker.get_cluster_info( |
| 348 | ray_client_pb2.ClusterInfoType.TIMELINE |
| 349 | ) |
| 350 | if filename is not None: |
| 351 | with open(filename, "w") as outfile: |
| 352 | json.dump(all_events, outfile) |
| 353 | else: |
| 354 | return all_events |
| 355 | |
| 356 | def _internal_kv_initialized(self) -> bool: |
| 357 | """Hook for internal_kv._internal_kv_initialized.""" |