You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/02/18 14:23:29 UTC
[GitHub] [cloudstack] rhtyd commented on a change in pull request #3894:
Fixed count value in the list apis
rhtyd commented on a change in pull request #3894: Fixed count value in the list apis
URL: https://github.com/apache/cloudstack/pull/3894#discussion_r380702071
##########
File path: plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
##########
@@ -140,7 +145,9 @@ public InfrastructureResponse listInfrastructure() {
response.setStoragePools(storagePoolDao.listAll().size());
response.setImageStores(imageStoreDao.listImageStores().size());
response.setSystemvms(vmInstanceDao.listByTypes(VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm).size());
- response.setRouters(domainRouterDao.listAll().size());
+ response.setRouters(domainRouterDao.listByRole(VirtualRouter.Role.VIRTUAL_ROUTER).size());
Review comment:
@Pearl1594 calling listAll() i.e. getting all the rows will make the APIs slow in a large env; this is fine but can you explore a way to simply get the count (instead of the rows).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services