mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-15 22:08:17 +00:00
Server statistics implementation
This commit is contained in:
@ -130,6 +130,24 @@ class ServerHandler:
|
||||
response.json(iou_license)
|
||||
response.set_status(201)
|
||||
|
||||
@Route.get(
|
||||
r"/statistics",
|
||||
description="Retrieve server statistics",
|
||||
status_codes={
|
||||
200: "Statistics information returned",
|
||||
409: "Conflict"
|
||||
})
|
||||
async def statistics(request, response):
|
||||
|
||||
compute_statistics = {}
|
||||
for compute in list(Controller.instance().computes.values()):
|
||||
try:
|
||||
r = await compute.get("/statistics")
|
||||
compute_statistics[compute.name] = r.json
|
||||
except HTTPConflict as e:
|
||||
log.error("Could not retrieve statistics on compute {}: {}".format(compute.name, e.text))
|
||||
response.json(compute_statistics)
|
||||
|
||||
@Route.post(
|
||||
r"/debug",
|
||||
description="Dump debug information to disk (debug directory in config directory). Work only for local server",
|
||||
|
Reference in New Issue
Block a user