cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [3/4] git commit: updated refs/heads/master to 8c3722d
Date Thu, 12 May 2016 20:49:44 GMT
Removed unnecessary check when creating the “userVmResponse” object.



Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/417d9a5d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/417d9a5d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/417d9a5d

Branch: refs/heads/master
Commit: 417d9a5d800facc48b6df46ada2e73223a16b5dd
Parents: 866ac7b
Author: weingartner <rafaelweingartner@gmail.com>
Authored: Wed May 4 15:27:17 2016 -0300
Committer: weingartner <rafaelweingartner@gmail.com>
Committed: Fri May 6 15:16:37 2016 -0300

----------------------------------------------------------------------
 .../cloud/api/query/dao/UserVmJoinDaoImpl.java  | 31 ++++++--------------
 1 file changed, 9 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/417d9a5d/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 552200b..106cd25 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -27,9 +27,6 @@ import java.util.Set;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
@@ -38,11 +35,12 @@ import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
 import org.apache.cloudstack.api.response.SecurityGroupResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.query.vo.UserVmJoinVO;
 import com.cloud.gpu.GPU;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.service.ServiceOfferingDetailsVO;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
@@ -200,27 +198,16 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation<UserVmJo
             VmStats vmStats = ApiDBUtils.getVmStatistics(userVm.getId());
             if (vmStats != null) {
                 userVmResponse.setCpuUsed(new DecimalFormat("#.##").format(vmStats.getCPUUtilization())
+ "%");
-
                 userVmResponse.setNetworkKbsRead((long)vmStats.getNetworkReadKBs());
-
                 userVmResponse.setNetworkKbsWrite((long)vmStats.getNetworkWriteKBs());
+                userVmResponse.setDiskKbsRead((long)vmStats.getDiskReadKBs());
+                userVmResponse.setDiskKbsWrite((long)vmStats.getDiskWriteKBs());
+                userVmResponse.setDiskIORead((long)vmStats.getDiskReadIOs());
+                userVmResponse.setDiskIOWrite((long)vmStats.getDiskWriteIOs());
+                userVmResponse.setMemoryKBs((long)vmStats.getMemoryKBs());
+                userVmResponse.setMemoryIntFreeKBs((long)vmStats.getIntFreeMemoryKBs());
+                userVmResponse.setMemoryTargetKBs((long)vmStats.getTargetMemoryKBs());
 
-                if ((userVm.getHypervisorType() != null) && (userVm.getHypervisorType().equals(HypervisorType.KVM)
|| userVm.getHypervisorType().equals(HypervisorType.XenServer) || userVm.getHypervisorType().equals(HypervisorType.VMware)))
{ // support KVM and XenServer only util 2013.06.25 . supporting Vmware from 2015.09.02
-                    userVmResponse.setDiskKbsRead((long)vmStats.getDiskReadKBs());
-
-                    userVmResponse.setDiskKbsWrite((long) vmStats.getDiskWriteKBs());
-
-                    userVmResponse.setDiskIORead((long) vmStats.getDiskReadIOs());
-
-                    userVmResponse.setDiskIOWrite((long) vmStats.getDiskWriteIOs());
-
-                    userVmResponse.setMemoryKBs((long) vmStats.getMemoryKBs());
-
-                    userVmResponse.setMemoryIntFreeKBs((long) vmStats.getIntFreeMemoryKBs());
-
-                    userVmResponse.setMemoryTargetKBs((long) vmStats.getTargetMemoryKBs());
-
-                }
             }
         }
 


Mime
View raw message