mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
CLOUDSTACK-1192: Disk I/O Statistics support KVM only util 20130625
This commit is contained in:
parent
82958f0d58
commit
3bb4ec9f65
@ -19,12 +19,12 @@ package com.cloud.vm;
|
||||
public interface VmDiskStats {
|
||||
// vm related disk stats
|
||||
|
||||
public Long getIORead();
|
||||
public long getIORead();
|
||||
|
||||
public Long getIOWrite();
|
||||
public long getIOWrite();
|
||||
|
||||
public Long getBytesRead();
|
||||
public long getBytesRead();
|
||||
|
||||
public Long getBytesWrite();
|
||||
public long getBytesWrite();
|
||||
|
||||
}
|
||||
|
||||
@ -22,15 +22,15 @@ public class VmDiskStatsEntry implements VmDiskStats {
|
||||
|
||||
String vmName;
|
||||
String path;
|
||||
Long ioRead = 0L;
|
||||
Long ioWrite = 0L;
|
||||
Long bytesWrite = 0L;
|
||||
Long bytesRead = 0L;
|
||||
long ioRead = 0;
|
||||
long ioWrite = 0;
|
||||
long bytesWrite = 0;
|
||||
long bytesRead = 0;
|
||||
|
||||
public VmDiskStatsEntry() {
|
||||
}
|
||||
|
||||
public VmDiskStatsEntry(String vmName, String path, Long ioWrite, Long ioRead, Long bytesWrite, Long bytesRead) {
|
||||
public VmDiskStatsEntry(String vmName, String path, long ioWrite, long ioRead, long bytesWrite, long bytesRead) {
|
||||
this.ioRead = ioRead;
|
||||
this.ioWrite = ioWrite;
|
||||
this.bytesRead = bytesRead;
|
||||
@ -55,35 +55,35 @@ public class VmDiskStatsEntry implements VmDiskStats {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setBytesRead(Long bytesRead) {
|
||||
public void setBytesRead(long bytesRead) {
|
||||
this.bytesRead = bytesRead;
|
||||
}
|
||||
|
||||
public Long getBytesRead() {
|
||||
public long getBytesRead() {
|
||||
return bytesRead;
|
||||
}
|
||||
|
||||
public void setBytesWrite(Long bytesWrite) {
|
||||
public void setBytesWrite(long bytesWrite) {
|
||||
this.bytesWrite = bytesWrite;
|
||||
}
|
||||
|
||||
public Long getBytesWrite() {
|
||||
public long getBytesWrite() {
|
||||
return bytesWrite;
|
||||
}
|
||||
|
||||
public void setIORead(Long ioRead) {
|
||||
public void setIORead(long ioRead) {
|
||||
this.ioRead = ioRead;
|
||||
}
|
||||
|
||||
public Long getIORead() {
|
||||
public long getIORead() {
|
||||
return ioRead;
|
||||
}
|
||||
|
||||
public void setIOWrite(Long ioWrite) {
|
||||
public void setIOWrite(long ioWrite) {
|
||||
this.ioWrite = ioWrite;
|
||||
}
|
||||
|
||||
public Long getIOWrite() {
|
||||
public long getIOWrite() {
|
||||
return ioWrite;
|
||||
}
|
||||
|
||||
|
||||
@ -65,6 +65,7 @@ import com.cloud.host.HostStats;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.resource.ResourceState;
|
||||
import com.cloud.storage.StorageManager;
|
||||
import com.cloud.storage.StoragePoolHostVO;
|
||||
@ -407,6 +408,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
|
||||
sc.addAnd("status", SearchCriteria.Op.EQ, Status.Up.toString());
|
||||
sc.addAnd("resourceState", SearchCriteria.Op.NIN, ResourceState.Maintenance, ResourceState.PrepareForMaintenance, ResourceState.ErrorInMaintenance);
|
||||
sc.addAnd("type", SearchCriteria.Op.EQ, Host.Type.Routing.toString());
|
||||
sc.addAnd("hypervisorType", SearchCriteria.Op.EQ, HypervisorType.KVM); // support KVM only util 2013.06.25
|
||||
List<HostVO> hosts = _hostDao.search(sc, null);
|
||||
|
||||
for (HostVO host : hosts) {
|
||||
|
||||
@ -3388,9 +3388,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
|
||||
|
||||
@Override
|
||||
public void collectVmDiskStatistics (UserVmVO userVm) {
|
||||
// support KVM and XenServer only
|
||||
if (!userVm.getHypervisorType().equals(HypervisorType.XenServer)
|
||||
&& !userVm.getHypervisorType().equals(HypervisorType.KVM))
|
||||
// support KVM only util 2013.06.25
|
||||
if (!userVm.getHypervisorType().equals(HypervisorType.KVM))
|
||||
return;
|
||||
// Collect vm disk statistics from host before stopping Vm
|
||||
long hostId = userVm.getHostId();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user