mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Return array for controller statistics endpoint
This commit is contained in:
1 parent
3df348ac2a
commit
a62168fde0
1 file changed
+2
-2
@@ -139,11 +139,11 @@ class ServerHandler:
|
||||
})
|
||||
async def statistics(request, response):
|
||||
|
||||
compute_statistics = {}
|
||||
compute_statistics = []
|
||||
for compute in list(Controller.instance().computes.values()):
|
||||
try:
|
||||
r = await compute.get("/statistics")
|
||||
compute_statistics[compute.name] = r.json
|
||||
compute_statistics.append({"compute_id": compute.id, "compute_name": compute.name, "statistics": r.json})
|
||||
except HTTPConflict as e:
|
||||
log.error("Could not retrieve statistics on compute {}: {}".format(compute.name, e.text))
|
||||
response.json(compute_statistics)
|
||||
|
||||
Reference in new issue
Block a user