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:
[email protected]


With regards,
Apache Git Services

Reply via email to