gpustat-web icon indicating copy to clipboard operation
gpustat-web copied to clipboard

Feature request - create an endpoint to expose gpustat_web to the command line

Open imaluengo opened this issue 2 years ago • 0 comments

Would be great to be able to access this information through the command line too.

It would require very little modification:

  1. Define a new endpoint
async def cmd_handler(request):
    body = ''
    for _, status in context.host_status.items():
        if not status:
            continue
        body += status
    return web.Response(text=body)
  1. Register the endpoint:
app.router.add_get('/cmd', cmd_handler)

And now the same user interface in the browser can be accessible from the command line by just using curl

$> curl http://localhost:48109/cmd

Which could be conveniently put into an alias alias gpustat-web=$(curl HTTP://localhost:48109/cmd)

imaluengo avatar Mar 08 '22 18:03 imaluengo