1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-17 22:08:35 +00:00

Return array for controller statistics endpoint

This commit is contained in:
grossmj 2020-01-17 17:07:30 +08:00
parent 3df348ac2a
commit a62168fde0

View File

@ -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)