mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 14:39:44 +08:00
First pass at ray memory command for memory debugging (#7589)
This commit is contained in:
@@ -945,10 +945,40 @@ def stat(address):
|
||||
channel = grpc.insecure_channel(raylet_address)
|
||||
stub = node_manager_pb2_grpc.NodeManagerServiceStub(channel)
|
||||
reply = stub.GetNodeStats(
|
||||
node_manager_pb2.GetNodeStatsRequest(), timeout=2.0)
|
||||
node_manager_pb2.GetNodeStatsRequest(include_memory_info=False),
|
||||
timeout=2.0)
|
||||
print(reply)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--address",
|
||||
required=False,
|
||||
type=str,
|
||||
help="Override the address to connect to.")
|
||||
def memory(address):
|
||||
if not address:
|
||||
address = services.find_redis_address_or_die()
|
||||
logger.info("Connecting to Ray instance at {}.".format(address))
|
||||
ray.init(address=address)
|
||||
print(ray.internal.internal_api.memory_summary())
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--address",
|
||||
required=False,
|
||||
type=str,
|
||||
help="Override the address to connect to.")
|
||||
def globalgc(address):
|
||||
if not address:
|
||||
address = services.find_redis_address_or_die()
|
||||
logger.info("Connecting to Ray instance at {}.".format(address))
|
||||
ray.init(address=address)
|
||||
ray.internal.internal_api.global_gc()
|
||||
print("Triggered gc.collect() on all workers.")
|
||||
|
||||
|
||||
cli.add_command(dashboard)
|
||||
cli.add_command(start)
|
||||
cli.add_command(stop)
|
||||
@@ -966,6 +996,8 @@ cli.add_command(get_worker_ips)
|
||||
cli.add_command(microbenchmark)
|
||||
cli.add_command(stack)
|
||||
cli.add_command(stat)
|
||||
cli.add_command(memory)
|
||||
cli.add_command(globalgc)
|
||||
cli.add_command(timeline)
|
||||
cli.add_command(project_cli)
|
||||
cli.add_command(session_cli)
|
||||
|
||||
Reference in New Issue
Block a user