Show service stats (ps + top)

This commit is contained in:
jpk 2023-01-16 14:45:59 +01:00
parent 6b23f27e2f
commit 0ab7f1fd62
1 changed files with 18 additions and 0 deletions

View File

@ -98,7 +98,25 @@ def update(ctx, service, remove):
services.docker_compose_command(command, compose_file)
@click.command(help="show service status (ps, top)")
@click.argument("service", nargs=1, shell_complete=complete_service_name)
@click.pass_context
@services.only_if_service_exists
def status(ctx, service):
compose_file = services.get_compose_file(
Path(ctx.obj["CONFIG"].root_directory) / service
)
print(Rule(f"Status of {service}"))
command_chain = [
["ps"],
["top"],
]
for command in command_chain:
services.docker_compose_command(command, compose_file)
main.add_command(list)
main.add_command(edit)
main.add_command(control)
main.add_command(update)
main.add_command(status)