gpustat-web
gpustat-web copied to clipboard
Feature request - create an endpoint to expose gpustat_web to the command line
Would be great to be able to access this information through the command line too.
It would require very little modification:
- 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)
- 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)