cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject git commit: updated refs/heads/master to c48b6c3
Date Mon, 21 Mar 2016 21:39:35 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master de173bd89 -> c48b6c33c


Revert "Merge pull request #780 from maneesha-p/pull-19" due code quality issues and lack
of CI results.

This reverts commit dc0ba6bd1a774d3ff4bc4a4dcc00e1434ab1f6e3, reversing
changes made to 63f58dd5785ff2515b087d907bdf686347c75727.


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

Branch: refs/heads/master
Commit: c48b6c33c0716d592d390ab01251664a59cd0e4f
Parents: de173bd
Author: Will Stevens <williamstevens@gmail.com>
Authored: Mon Mar 21 17:38:04 2016 -0400
Committer: Will Stevens <williamstevens@gmail.com>
Committed: Mon Mar 21 17:38:04 2016 -0400

----------------------------------------------------------------------
 api/src/com/cloud/vm/VmStats.java               |  6 ----
 .../cloudstack/api/response/UserVmResponse.java | 36 --------------------
 core/src/com/cloud/agent/api/VmStatsEntry.java  | 35 +------------------
 .../kvm/resource/LibvirtComputingResource.java  | 13 -------
 .../resource/LibvirtComputingResourceTest.java  | 11 +-----
 .../cloud/agent/manager/MockVmManagerImpl.java  |  2 +-
 .../vmware/resource/VmwareResource.java         | 24 +++----------
 .../xenserver/resource/CitrixResourceBase.java  | 12 ++-----
 .../cloud/api/query/dao/UserVmJoinDaoImpl.java  | 15 +++-----
 server/src/com/cloud/server/StatsCollector.java |  7 ----
 10 files changed, 13 insertions(+), 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/api/src/com/cloud/vm/VmStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VmStats.java b/api/src/com/cloud/vm/VmStats.java
index 1c23c01..2b79438 100644
--- a/api/src/com/cloud/vm/VmStats.java
+++ b/api/src/com/cloud/vm/VmStats.java
@@ -32,10 +32,4 @@ public interface VmStats {
 
     public double getDiskWriteKBs();
 
-    public double getMemoryKBs();
-
-    public double getIntFreeMemoryKBs();
-
-    public double getTargetMemoryKBs();
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
index f1119dd..e8d1a9e 100644
--- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
@@ -196,18 +196,6 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
     @Param(description = "the write (bytes) of disk on the vm")
     private Long diskKbsWrite;
 
-    @SerializedName("memorykbs")
-    @Param(description = "the memory used by the vm")
-    private Long memoryKBs;
-
-    @SerializedName("memoryintfreekbs")
-    @Param(description = "the internal memory thats free in vm")
-    private Long memoryIntFreeKBs;
-
-    @SerializedName("memorytargetkbs")
-    @Param(description = "the target memory in vm")
-    private Long memoryTargetKBs;
-
     @SerializedName("diskioread")
     @Param(description = "the read (io) of disk on the vm")
     private Long diskIORead;
@@ -478,18 +466,6 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
         return diskKbsWrite;
     }
 
-    public Long getMemoryKBs() {
-        return memoryKBs;
-    }
-
-    public Long getMemoryIntFreeKBs() {
-        return memoryIntFreeKBs;
-    }
-
-    public Long getMemoryTargetKBs() {
-        return memoryTargetKBs;
-    }
-
     public Long getDiskIORead() {
         return diskIORead;
     }
@@ -669,18 +645,6 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp
         this.diskIORead = diskIORead;
     }
 
-    public void setMemoryKBs(Long memoryKBs) {
-        this.memoryKBs = memoryKBs;
-    }
-
-    public void setMemoryIntFreeKBs(Long memoryIntFreeKBs) {
-        this.memoryIntFreeKBs = memoryIntFreeKBs;
-    }
-
-    public void setMemoryTargetKBs(Long memoryTargetKBs) {
-        this.memoryTargetKBs = memoryTargetKBs;
-    }
-
     public void setDiskIOWrite(Long diskIOWrite) {
         this.diskIOWrite = diskIOWrite;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/core/src/com/cloud/agent/api/VmStatsEntry.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/VmStatsEntry.java b/core/src/com/cloud/agent/api/VmStatsEntry.java
index e6063b9..0f30b6a 100644
--- a/core/src/com/cloud/agent/api/VmStatsEntry.java
+++ b/core/src/com/cloud/agent/api/VmStatsEntry.java
@@ -30,19 +30,13 @@ public class VmStatsEntry implements VmStats {
     double diskWriteIOs;
     double diskReadKBs;
     double diskWriteKBs;
-    double memoryKBs;
-    double intfreememoryKBs;
-    double targetmemoryKBs;
     int numCPUs;
     String entityType;
 
     public VmStatsEntry() {
     }
 
-    public VmStatsEntry(double memoryKBs,double intfreememoryKBs,double targetmemoryKBs,
double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String
entityType) {
-        this.memoryKBs = memoryKBs;
-        this.intfreememoryKBs = intfreememoryKBs;
-        this.targetmemoryKBs = targetmemoryKBs;
+    public VmStatsEntry(double cpuUtilization, double networkReadKBs, double networkWriteKBs,
int numCPUs, String entityType) {
         this.cpuUtilization = cpuUtilization;
         this.networkReadKBs = networkReadKBs;
         this.networkWriteKBs = networkWriteKBs;
@@ -123,33 +117,6 @@ public class VmStatsEntry implements VmStats {
         this.diskWriteKBs = diskWriteKBs;
     }
 
-    @Override
-    public double getMemoryKBs() {
-        return memoryKBs;
-    }
-
-    public void setMemoryKBs(double memoryKBs) {
-        this.memoryKBs = memoryKBs;
-    }
-
-    @Override
-    public double getIntFreeMemoryKBs() {
-        return intfreememoryKBs;
-    }
-
-    public void setIntFreeMemoryKBs(double intfreememoryKBs) {
-        this.intfreememoryKBs = intfreememoryKBs;
-    }
-
-    @Override
-    public double getTargetMemoryKBs() {
-        return targetmemoryKBs;
-    }
-
-    public void setTargetMemoryKBs(double targetmemoryKBs) {
-        this.targetmemoryKBs = targetmemoryKBs;
-    }
-
     public int getNumCPUs() {
         return numCPUs;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
old mode 100644
new mode 100755
index 02cf872..883c8c9
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -57,7 +57,6 @@ import org.libvirt.Connect;
 import org.libvirt.Domain;
 import org.libvirt.DomainBlockStats;
 import org.libvirt.DomainInfo;
-import org.libvirt.MemoryStatistic;
 import org.libvirt.DomainInfo.DomainState;
 import org.libvirt.DomainInterfaceStats;
 import org.libvirt.LibvirtException;
@@ -191,7 +190,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
     private long _hvVersion;
     private long _kernelVersion;
     private int _timeout;
-    private static final int NUMMEMSTATS =2;
 
     private KVMHAMonitor _monitor;
     public static final String SSHKEYSPATH = "/root/.ssh";
@@ -3020,9 +3018,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         long _ioWrote;
         long _bytesRead;
         long _bytesWrote;
-        long _intmemfree;
-        long _memory;
-        long _maxmemory;
         Calendar _timestamp;
     }
 
@@ -3031,16 +3026,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         try {
             dm = getDomain(conn, vmName);
             final DomainInfo info = dm.getInfo();
-            final MemoryStatistic[] mems = dm.memoryStats(NUMMEMSTATS);      //number of
memory statistics required.
 
             final VmStatsEntry stats = new VmStatsEntry();
-
             stats.setNumCPUs(info.nrVirtCpu);
             stats.setEntityType("vm");
 
-            stats.setMemoryKBs(info.maxMem);
-            stats.setTargetMemoryKBs(info.memory);
-            stats.setIntFreeMemoryKBs((double) mems[0].getValue());
             /* get cpu utilization */
             VmStats oldStats = null;
 
@@ -3125,9 +3115,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
             newStat._bytesRead = bytes_rd;
             newStat._bytesWrote = bytes_wr;
             newStat._timestamp = now;
-            newStat._intmemfree = mems[0].getValue();
-            newStat._memory = info.memory;
-            newStat._maxmemory = info.maxMem;
             _vmStats.put(vmName, newStat);
             return stats;
         } finally {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
index 47b9c40..04a27f3 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
@@ -66,8 +66,6 @@ import org.libvirt.DomainInterfaceStats;
 import org.libvirt.LibvirtException;
 import org.libvirt.NodeInfo;
 import org.libvirt.StorageVol;
-import org.libvirt.MemoryStatistic;
-
 import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
@@ -419,10 +417,7 @@ public class LibvirtComputingResourceTest {
         final Connect connect = Mockito.mock(Connect.class);
         final Domain domain = Mockito.mock(Domain.class);
         final DomainInfo domainInfo = new DomainInfo();
-        final MemoryStatistic[] domainMem = new MemoryStatistic[2];
-        domainMem[0] = Mockito.mock(MemoryStatistic.class);
         Mockito.when(domain.getInfo()).thenReturn(domainInfo);
-        Mockito.when(domain.memoryStats(2)).thenReturn(domainMem);
         Mockito.when(connect.domainLookupByName(VMNAME)).thenReturn(domain);
         final NodeInfo nodeInfo = new NodeInfo();
         nodeInfo.cpus = 8;
@@ -489,10 +484,6 @@ public class LibvirtComputingResourceTest {
         // IO traffic as generated by the logic above, must be greater than zero
         Assert.assertTrue(vmStat.getDiskReadKBs() > 0);
         Assert.assertTrue(vmStat.getDiskWriteKBs() > 0);
-        // Memory limit of VM must be greater than zero
-        Assert.assertTrue(vmStat.getIntFreeMemoryKBs() >= 0);
-        Assert.assertTrue(vmStat.getMemoryKBs() >= 0);
-        Assert.assertTrue(vmStat.getTargetMemoryKBs() >= vmStat.getMemoryKBs());
     }
 
     @Test
@@ -5030,4 +5021,4 @@ public class LibvirtComputingResourceTest {
             }
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index 9863b22..6602e1f 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -319,7 +319,7 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
         final HashMap<String, VmStatsEntry> vmStatsNameMap = new HashMap<String,
VmStatsEntry>();
         final List<String> vmNames = cmd.getVmNames();
         for (final String vmName : vmNames) {
-            final VmStatsEntry entry = new VmStatsEntry(0, 0, 0, 0, 0, 0, 0, "vm");
+            final VmStatsEntry entry = new VmStatsEntry(0, 0, 0, 0, "vm");
             entry.setNetworkReadKBs(32768); // default values 256 KBps
             entry.setNetworkWriteKBs(16384);
             entry.setCPUUtilization(10);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 4d04abc..184159a 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -100,7 +100,6 @@ import com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec;
 import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
-import org.apache.commons.lang.math.NumberUtils;
 
 import com.cloud.agent.IAgentControl;
 import com.cloud.agent.api.Answer;
@@ -4945,14 +4944,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
         }
         String instanceNameCustomField = "value[" + key + "]";
 
-        final String numCpuStr = "summary.config.numCpu";
-        final String cpuUseStr = "summary.quickStats.overallCpuUsage";
-        final String guestMemUseStr = "summary.quickStats.guestMemoryUsage";
-        final String memLimitStr = "resourceConfig.memoryAllocation.limit";
-        final String memMbStr = "config.hardware.memoryMB";
-
         ObjectContent[] ocs =
-                hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", numCpuStr, cpuUseStr
,guestMemUseStr ,memLimitStr ,memMbStr, instanceNameCustomField});
+                hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", "summary.config.numCpu",
"summary.quickStats.overallCpuUsage", instanceNameCustomField});
         if (ocs != null && ocs.length > 0) {
             for (ObjectContent oc : ocs) {
                 List<DynamicProperty> objProps = oc.getPropSet();
@@ -4960,9 +4953,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                     String name = null;
                     String numberCPUs = null;
                     String maxCpuUsage = null;
-                    String memlimit = null;
-                    String memkb = null;
-                    String guestMemusage = null;
                     String vmNameOnVcenter = null;
                     String vmInternalCSName = null;
                     for (DynamicProperty objProp : objProps) {
@@ -4971,16 +4961,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                         } else if (objProp.getName().contains(instanceNameCustomField)) {
                             if (objProp.getVal() != null)
                                 vmInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
-                        }else if(objProp.getName().equals(guestMemusage)){
-                            guestMemusage = objProp.getVal().toString();
-                        }else if (objProp.getName().equals(numCpuStr)) {
+                        } else if (objProp.getName().equals("summary.config.numCpu")) {
                             numberCPUs = objProp.getVal().toString();
-                        } else if (objProp.getName().equals(cpuUseStr)) {
+                        } else if (objProp.getName().equals("summary.quickStats.overallCpuUsage"))
{
                             maxCpuUsage = objProp.getVal().toString();
-                        } else if (objProp.getName().equals(memLimitStr)) {
-                            memlimit = objProp.getVal().toString();
-                        } else if (objProp.getName().equals(memMbStr)) {
-                            memkb = objProp.getVal().toString();
                         }
                     }
                     new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
@@ -5049,7 +5033,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                             }
                         }
                     }
-                    vmResponseMap.put(name, new VmStatsEntry( NumberUtils.toDouble(memkb)*1024,NumberUtils.toDouble(guestMemusage)*1024,NumberUtils.toDouble(memlimit)*1024,
NumberUtils.toDouble(maxCpuUsage), networkReadKBs, networkWriteKBs, NumberUtils.toInt(numberCPUs),
"vm"));
+                    vmResponseMap.put(name, new VmStatsEntry(Integer.parseInt(maxCpuUsage),
networkReadKBs, networkWriteKBs, Integer.parseInt(numberCPUs), "vm"));
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 665ed77..7c8bca7 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -3278,7 +3278,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
         final HashMap<String, VmStatsEntry> vmResponseMap = new HashMap<String,
VmStatsEntry>();
 
         for (final String vmUUID : vmUUIDs) {
-            vmResponseMap.put(vmUUID, new VmStatsEntry(0,0,0,0, 0, 0, 0, "vm"));
+            vmResponseMap.put(vmUUID, new VmStatsEntry(0, 0, 0, 0, "vm"));
         }
 
         final Object[] rrdData = getRRDData(conn, 2); // call rrddata with 2 for
@@ -3332,14 +3332,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                     vmStatsAnswer.setDiskReadKBs(vmStatsAnswer.getDiskReadKBs() + getDataAverage(dataNode,
col, numRows) / 1000);
                 } else if (param.matches("vbd_.*_write")) {
                     vmStatsAnswer.setDiskWriteKBs(vmStatsAnswer.getDiskWriteKBs() + getDataAverage(dataNode,
col, numRows) / 1000);
-                } else if (param.contains("memory_internal_free")) {
-                    vmStatsAnswer.setIntFreeMemoryKBs(vmStatsAnswer.getIntFreeMemoryKBs()
+ getDataAverage(dataNode, col, numRows) / 1024);
-                } else if (param.contains("memory_target")) {
-                    vmStatsAnswer.setTargetMemoryKBs(vmStatsAnswer.getTargetMemoryKBs() +
getDataAverage(dataNode, col, numRows) / 1024);
-                } else if (param.contains("memory")) {
-                    vmStatsAnswer.setMemoryKBs(vmStatsAnswer.getMemoryKBs() + getDataAverage(dataNode,
col, numRows) / 1024);
                 }
-
             }
         }
 
@@ -3355,7 +3348,6 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 s_logger.debug("Vm cpu utilization " + vmStatsAnswer.getCPUUtilization());
             }
         }
-
         return vmResponseMap;
     }
 
@@ -5402,4 +5394,4 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
 
     }
 
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/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 a1e3dc9..7983065 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -207,21 +207,14 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO,
Long> implem
 
                 userVmResponse.setNetworkKbsWrite((long)vmStats.getNetworkWriteKBs());
 
-                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
+                if ((userVm.getHypervisorType() != null) && (userVm.getHypervisorType().equals(HypervisorType.KVM)
|| userVm.getHypervisorType().equals(HypervisorType.XenServer))) { // support KVM and XenServer
only util 2013.06.25
                     userVmResponse.setDiskKbsRead((long)vmStats.getDiskReadKBs());
 
-                    userVmResponse.setDiskKbsWrite((long) vmStats.getDiskWriteKBs());
+                    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());
+                    userVmResponse.setDiskIORead((long)vmStats.getDiskReadIOs());
 
+                    userVmResponse.setDiskIOWrite((long)vmStats.getDiskWriteIOs());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c48b6c33/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 387639f..0702335 100644
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -464,9 +464,6 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                                     statsInMemory.setDiskReadIOs(statsInMemory.getDiskReadIOs()
+ statsForCurrentIteration.getDiskReadIOs());
                                     statsInMemory.setDiskWriteIOs(statsInMemory.getDiskWriteIOs()
+ statsForCurrentIteration.getDiskWriteIOs());
                                     statsInMemory.setDiskReadKBs(statsInMemory.getDiskReadKBs()
+ statsForCurrentIteration.getDiskReadKBs());
-                                    statsInMemory.setMemoryKBs(statsForCurrentIteration.getMemoryKBs());
-                                    statsInMemory.setIntFreeMemoryKBs(statsForCurrentIteration.getIntFreeMemoryKBs());
-                                    statsInMemory.setTargetMemoryKBs(statsForCurrentIteration.getTargetMemoryKBs());
 
                                     _VmStats.put(vmId, statsInMemory);
                                 }
@@ -487,10 +484,6 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
                                     metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".disk.read_kbs", statsForCurrentIteration.getDiskReadKBs());
                                     metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".disk.write_iops", statsForCurrentIteration.getDiskWriteIOs());
                                     metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".disk.read_iops", statsForCurrentIteration.getDiskReadIOs());
-                                    metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".memory.total_kbs", statsForCurrentIteration.getMemoryKBs());
-                                    metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".memory.internalfree_kbs", statsForCurrentIteration.getIntFreeMemoryKBs());
-                                    metrics.put(externalStatsPrefix + "cloudstack.stats.instances."
+ vmName + ".memory.target_kbs", statsForCurrentIteration.getTargetMemoryKBs());
-
                                 }
 
                             }


Mime
View raw message