From cc2fbb0bed52982cd2430ec778349532a85087de Mon Sep 17 00:00:00 2001 From: fanfuxiaoran <495538672@qq.com> Date: Wed, 5 Mar 2014 16:54:59 +0800 Subject: [PATCH] change the monitor model,using the newest --- .../MonitorLogicalDiskResponseModel.java | 14 +- .../master/MonitorResultContainerModel.java | 10 +- .../statistics/ScriptBriefResultModel.java | 1 - .../monitor/{latest => }/FileSystemModel.java | 6 +- .../models/monitor/LogicalDiskModel.java | 31 ---- .../models/monitor/LogicalDiskModelChild.java | 159 ----------------- .../share/models/monitor/MemoryModel.java | 167 ++++++++++-------- .../MainModel.java => MonitorMain.java} | 10 +- .../models/monitor/NetworkInterfaceModel.java | 73 +++++--- .../monitor/NetworkInterfaceModelChild.java | 44 ----- .../{latest => }/PhysicalDiskModel.java | 6 +- .../monitor/{latest => }/ProcessModel.java | 6 +- .../{latest => }/ProcessModelChild.java | 6 +- .../share/models/monitor/ProcessorModel.java | 117 ++++++++---- .../models/monitor/ProcessorModelChild.java | 38 ++-- .../models/monitor/latest/ListMainModel.java | 22 --- .../models/monitor/latest/MemoryModel.java | 92 ---------- .../monitor/latest/NetworkInterfaceModel.java | 42 ----- .../models/monitor/latest/ProcessorModel.java | 85 --------- .../monitor/latest/ProcessorModelChild.java | 49 ----- 20 files changed, 284 insertions(+), 694 deletions(-) rename src/main/java/org/bench4q/share/models/monitor/{latest => }/FileSystemModel.java (91%) delete mode 100644 src/main/java/org/bench4q/share/models/monitor/LogicalDiskModel.java delete mode 100644 src/main/java/org/bench4q/share/models/monitor/LogicalDiskModelChild.java rename src/main/java/org/bench4q/share/models/monitor/{latest/MainModel.java => MonitorMain.java} (76%) delete mode 100644 src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModelChild.java rename src/main/java/org/bench4q/share/models/monitor/{latest => }/PhysicalDiskModel.java (92%) rename src/main/java/org/bench4q/share/models/monitor/{latest => }/ProcessModel.java (88%) rename src/main/java/org/bench4q/share/models/monitor/{latest => }/ProcessModelChild.java (88%) delete mode 100644 src/main/java/org/bench4q/share/models/monitor/latest/ListMainModel.java delete mode 100644 src/main/java/org/bench4q/share/models/monitor/latest/MemoryModel.java delete mode 100644 src/main/java/org/bench4q/share/models/monitor/latest/NetworkInterfaceModel.java delete mode 100644 src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModel.java delete mode 100644 src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModelChild.java diff --git a/src/main/java/org/bench4q/share/models/master/MonitorLogicalDiskResponseModel.java b/src/main/java/org/bench4q/share/models/master/MonitorLogicalDiskResponseModel.java index 9c102b3f..465c19d8 100644 --- a/src/main/java/org/bench4q/share/models/master/MonitorLogicalDiskResponseModel.java +++ b/src/main/java/org/bench4q/share/models/master/MonitorLogicalDiskResponseModel.java @@ -8,7 +8,7 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import org.bench4q.share.models.master.statistics.SampleModel; -import org.bench4q.share.models.monitor.LogicalDiskModel; +import org.bench4q.share.models.monitor.PhysicalDiskModel; /** * When asked for logicalDisk, this model will be response @@ -18,25 +18,25 @@ import org.bench4q.share.models.monitor.LogicalDiskModel; */ @XmlRootElement(name = "MonitorLogicalDiskResponseModel") public class MonitorLogicalDiskResponseModel implements MonitorResultBase { - private List logicalDiskModels; + private List logicalDiskModels; @XmlElementWrapper @XmlElement(name = "logicalDiskModel") - public List getLogicalDiskModels() { + public List getLogicalDiskModels() { return logicalDiskModels; } - public void setLogicalDiskModels(List logicalDiskModels) { + public void setLogicalDiskModels(List logicalDiskModels) { this.logicalDiskModels = logicalDiskModels; } public MonitorLogicalDiskResponseModel() { - this.setLogicalDiskModels(new ArrayList()); + this.setLogicalDiskModels(new ArrayList()); } public void add(SampleModel model) { - if (model instanceof LogicalDiskModel) { - this.getLogicalDiskModels().add((LogicalDiskModel) model); + if (model instanceof PhysicalDiskModel) { + this.getLogicalDiskModels().add((PhysicalDiskModel) model); } } diff --git a/src/main/java/org/bench4q/share/models/master/MonitorResultContainerModel.java b/src/main/java/org/bench4q/share/models/master/MonitorResultContainerModel.java index 69f13322..207cd8a3 100644 --- a/src/main/java/org/bench4q/share/models/master/MonitorResultContainerModel.java +++ b/src/main/java/org/bench4q/share/models/master/MonitorResultContainerModel.java @@ -3,22 +3,22 @@ package org.bench4q.share.models.master; import java.util.ArrayList; import java.util.List; -import org.bench4q.share.models.monitor.LogicalDiskModel; import org.bench4q.share.models.monitor.MemoryModel; import org.bench4q.share.models.monitor.NetworkInterfaceModel; +import org.bench4q.share.models.monitor.PhysicalDiskModel; import org.bench4q.share.models.monitor.ProcessorModel; public class MonitorResultContainerModel { - private List logicalDiskModels; + private List logicalDiskModels; private List memoryModels; private List processorModels; private List netWorkModels; - public List getLogicalDiskModels() { + public List getLogicalDiskModels() { return logicalDiskModels; } - public void setLogicalDiskModels(List logicalDiskModels) { + public void setLogicalDiskModels(List logicalDiskModels) { this.logicalDiskModels = logicalDiskModels; } @@ -47,7 +47,7 @@ public class MonitorResultContainerModel { } public MonitorResultContainerModel() { - this.setLogicalDiskModels(new ArrayList()); + this.setLogicalDiskModels(new ArrayList()); this.setMemoryModels(new ArrayList()); this.setProcessorModels(new ArrayList()); this.setNetWorkModels(new ArrayList()); diff --git a/src/main/java/org/bench4q/share/models/master/statistics/ScriptBriefResultModel.java b/src/main/java/org/bench4q/share/models/master/statistics/ScriptBriefResultModel.java index 96d8b8fe..067e77a9 100644 --- a/src/main/java/org/bench4q/share/models/master/statistics/ScriptBriefResultModel.java +++ b/src/main/java/org/bench4q/share/models/master/statistics/ScriptBriefResultModel.java @@ -15,7 +15,6 @@ public class ScriptBriefResultModel extends SampleModel { private long failThroughputThisTime; private long responseTimeDeviationThisTime; private long failRateThisTime; - private long averageElapsedTime; private long planedRunningTime; private long vUserCount; diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/FileSystemModel.java b/src/main/java/org/bench4q/share/models/monitor/FileSystemModel.java similarity index 91% rename from src/main/java/org/bench4q/share/models/monitor/latest/FileSystemModel.java rename to src/main/java/org/bench4q/share/models/monitor/FileSystemModel.java index 974dbdeb..97cfb51a 100644 --- a/src/main/java/org/bench4q/share/models/monitor/latest/FileSystemModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/FileSystemModel.java @@ -1,10 +1,12 @@ -package org.bench4q.share.models.monitor.latest; +package org.bench4q.share.models.monitor; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import org.bench4q.share.models.master.statistics.SampleModel; + @XmlRootElement(name = "fileSystem") -public class FileSystemModel { +public class FileSystemModel extends SampleModel{ private String fileDir; private Double diskReadKBytesRate; private Double diskWriteKBytesRate; diff --git a/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModel.java b/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModel.java deleted file mode 100644 index 1f334a6d..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModel.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.bench4q.share.models.monitor; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.bench4q.share.models.master.statistics.SampleModel; - -@XmlRootElement(name = "LogicalDisk") -public class LogicalDiskModel extends SampleModel { - - private List logicalDiskList; - - public LogicalDiskModel() { - this.logicalDiskList = new ArrayList(); - } - - @XmlElementWrapper - @XmlElement(name = "Instance", type = LogicalDiskModelChild.class) - public List getLogicalDiskList() { - return logicalDiskList; - } - - public void setLogicalDiskList( - ArrayList logicalDiskList) { - this.logicalDiskList = logicalDiskList; - } -} \ No newline at end of file diff --git a/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModelChild.java b/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModelChild.java deleted file mode 100644 index e4370497..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/LogicalDiskModelChild.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.bench4q.share.models.monitor; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.bench4q.share.models.master.statistics.SampleModel; - -@XmlRootElement -public class LogicalDiskModelChild extends SampleModel { - private String instance; - private double freeSpacePercent; - private double freeMegabytes; - - // ���̻�ٷֱ� - private double diskTimePercent; - private double diskReadTimePercent; - private double diskWriteTimePercent; - - // ����ƽ��ʱ��? - private double averageDiskTransferTimeInSecond; - private double averageDiskReadTimeInSecond; - private double averageDiskWriteTimeInSecond; - // ����ƽ������ֽ�? - - private double diskBytesPerSecond; - - private double diskReadBytesPerSecond; - private double diskWriteBytesPerSecond; - - // ���аٷֱ� - private double idleTimePercent; - // ƽ����г���? - private double averageDiskQueueLength; - // ��ǰ���г��� - private double currentDiskQueueLength; - - public String getInstance() { - return instance; - } - - public void setInstance(String instance) { - this.instance = instance; - } - - public double getFreeSpacePercent() { - return freeSpacePercent; - } - - public void setFreeSpacePercent(double freeSpacePercent) { - this.freeSpacePercent = freeSpacePercent; - } - - public double getFreeMegabytes() { - return freeMegabytes; - } - - public void setFreeMegabytes(double freeMegabytes) { - this.freeMegabytes = freeMegabytes; - } - - public double getDiskTimePercent() { - return diskTimePercent; - } - - public void setDiskTimePercent(double diskTimePercent) { - this.diskTimePercent = diskTimePercent; - } - - public double getDiskReadTimePercent() { - return diskReadTimePercent; - } - - public void setDiskReadTimePercent(double diskReadTimePercent) { - this.diskReadTimePercent = diskReadTimePercent; - } - - public double getDiskWriteTimePercent() { - return diskWriteTimePercent; - } - - public void setDiskWriteTimePercent(double diskWriteTimePercent) { - this.diskWriteTimePercent = diskWriteTimePercent; - } - - public double getAverageDiskTransferTimeInSecond() { - return averageDiskTransferTimeInSecond; - } - - public void setAverageDiskTransferTimeInSecond( - double averageDiskTransferTimeInSecond) { - this.averageDiskTransferTimeInSecond = averageDiskTransferTimeInSecond; - } - - public double getAverageDiskReadTimeInSecond() { - return averageDiskReadTimeInSecond; - } - - public void setAverageDiskReadTimeInSecond( - double averageDiskReadTimeInSecond) { - this.averageDiskReadTimeInSecond = averageDiskReadTimeInSecond; - } - - public double getAverageDiskWriteTimeInSecond() { - return averageDiskWriteTimeInSecond; - } - - public void setAverageDiskWriteTimeInSecond( - double averageDiskWriteTimeInSecond) { - this.averageDiskWriteTimeInSecond = averageDiskWriteTimeInSecond; - } - - public double getDiskBytesPerSecond() { - return diskBytesPerSecond; - } - - public void setDiskBytesPerSecond(double diskBytesPerSecond) { - this.diskBytesPerSecond = diskBytesPerSecond; - } - - public double getDiskReadBytesPerSecond() { - return diskReadBytesPerSecond; - } - - public void setDiskReadBytesPerSecond(double diskReadBytesPerSecond) { - this.diskReadBytesPerSecond = diskReadBytesPerSecond; - } - - public double getDiskWriteBytesPerSecond() { - return diskWriteBytesPerSecond; - } - - public void setDiskWriteBytesPerSecond(double diskkWriteBytesPerSecond) { - this.diskWriteBytesPerSecond = diskkWriteBytesPerSecond; - } - - public double getIdleTimePercent() { - return idleTimePercent; - } - - public void setIdleTimePercent(double idleTimePercent) { - this.idleTimePercent = idleTimePercent; - } - - public double getAverageDiskQueueLength() { - return averageDiskQueueLength; - } - - public void setAverageDiskQueueLength(double averageDiskQueueLength) { - this.averageDiskQueueLength = averageDiskQueueLength; - } - - public double getCurrentDiskQueueLength() { - return currentDiskQueueLength; - } - - public void setCurrentDiskQueueLength(double currentDiskQueueLength) { - this.currentDiskQueueLength = currentDiskQueueLength; - } - -} diff --git a/src/main/java/org/bench4q/share/models/monitor/MemoryModel.java b/src/main/java/org/bench4q/share/models/monitor/MemoryModel.java index e85bf5b4..92719f49 100644 --- a/src/main/java/org/bench4q/share/models/monitor/MemoryModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/MemoryModel.java @@ -1,73 +1,94 @@ -package org.bench4q.share.models.monitor; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.bench4q.share.models.master.statistics.SampleModel; - -@XmlRootElement(name = "Memory") -public class MemoryModel extends SampleModel { - - // private double pageFaultsPerSecond;//������Ӳȱҳ - private double pagesPerSecond; - private double pagesInputPerSecond; - private double pagesOutputPerSecond; - private double cacheBytes; - private double committedBytes;// ռ�õ������ڴ���ֽ�? - private double availableKiloBytes; - - @XmlElement - public double getPagesPerSecond() { - return pagesPerSecond; - } - - public void setPagesPerSecond(double pagesPerSecond) { - this.pagesPerSecond = pagesPerSecond; - } - - @XmlElement - public double getPagesInputPerSecond() { - return pagesInputPerSecond; - } - - public void setPagesInputPerSecond(double pagesInputPerSecond) { - this.pagesInputPerSecond = pagesInputPerSecond; - } - - @XmlElement - public double getCacheBytes() { - return cacheBytes; - } - - public void setCacheBytes(double cacheBytes) { - this.cacheBytes = cacheBytes; - } - - @XmlElement - public double getCommittedBytes() { - return committedBytes; - } - - public void setCommittedBytes(double committedBytes) { - this.committedBytes = committedBytes; - } - - @XmlElement - public double getPagesOutputPerSecond() { - return pagesOutputPerSecond; - } - - public void setPagesOutputPerSecond(double pagesOutputPerSecond) { - this.pagesOutputPerSecond = pagesOutputPerSecond; - } - - @XmlElement - public double getAvailableKiloBytes() { - return availableKiloBytes; - } - - public void setAvailableKiloBytes(double availableKiloBytes) { - this.availableKiloBytes = availableKiloBytes; - } - -} +package org.bench4q.share.models.monitor; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import org.bench4q.share.models.master.statistics.SampleModel; + +@XmlRootElement(name = "Memory") +public class MemoryModel extends SampleModel{ + private long pagesPerSecond; + private long pagesInputPerSecond; + private long pagesOutputPerSecond; + private long availableKiloBytes; + private long totalKiloBytes; + private double memoryUsedPercent; + private double swapKiloBytes; + private double swapFreeKiloBytes; + + public MemoryModel() { + } + + @XmlElement + public long getPagesPerSecond() { + return pagesPerSecond; + } + + public void setPagesPerSecond(long pagesPerSecond) { + this.pagesPerSecond = pagesPerSecond; + } + + @XmlElement + public long getPagesInputPerSecond() { + return pagesInputPerSecond; + } + + public void setPagesInputPerSecond(long pagesInputPerSecond) { + this.pagesInputPerSecond = pagesInputPerSecond; + } + + @XmlElement + public long getPagesOutputPerSecond() { + return pagesOutputPerSecond; + } + + public void setPagesOutputPerSecond(long pagesOutputPerSecond) { + this.pagesOutputPerSecond = pagesOutputPerSecond; + } + + @XmlElement + public long getAvailableKiloBytes() { + return availableKiloBytes; + } + + public void setAvailableKiloBytes(long availableKiloBytes) { + this.availableKiloBytes = availableKiloBytes; + } + + @XmlElement + public long getTotalKiloBytes() { + return totalKiloBytes; + } + + public void setTotalKiloBytes(long totalKiloBytes) { + this.totalKiloBytes = totalKiloBytes; + } + + @XmlElement + public double getMemoryUsedPercent() { + return memoryUsedPercent; + } + + public void setMemoryUsedPercent(double memoryUsedPercent) { + this.memoryUsedPercent = memoryUsedPercent; + } + + @XmlElement + public double getSwapKiloBytes() { + return swapKiloBytes; + } + + public void setSwapKiloBytes(double swapKiloBytes) { + this.swapKiloBytes = swapKiloBytes; + } + + @XmlElement + public double getSwapFreeKiloBytes() { + return swapFreeKiloBytes; + } + + public void setSwapFreeKiloBytes(double swapFreeKiloBytes) { + this.swapFreeKiloBytes = swapFreeKiloBytes; + } + +} diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/MainModel.java b/src/main/java/org/bench4q/share/models/monitor/MonitorMain.java similarity index 76% rename from src/main/java/org/bench4q/share/models/monitor/latest/MainModel.java rename to src/main/java/org/bench4q/share/models/monitor/MonitorMain.java index 5edb341e..9ba99485 100644 --- a/src/main/java/org/bench4q/share/models/monitor/latest/MainModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/MonitorMain.java @@ -1,14 +1,14 @@ -package org.bench4q.share.models.monitor.latest; +package org.bench4q.share.models.monitor; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; +import org.bench4q.share.models.master.statistics.SampleModel; + @XmlRootElement(name = "history") @XmlType -public class MainModel { - @XmlElement - private String date; +public class MonitorMain extends SampleModel{ @XmlElement(name = "processor_info") private ProcessorModel processorModel; @XmlElement(name = "memory_info") @@ -20,7 +20,7 @@ public class MainModel { @XmlElement(name = "process_info") private ProcessModel processModel; - public MainModel() { + public MonitorMain() { } } diff --git a/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModel.java b/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModel.java index ee90751f..839fe1bd 100644 --- a/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModel.java @@ -1,29 +1,44 @@ -package org.bench4q.share.models.monitor; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.bench4q.share.models.master.statistics.SampleModel; - -@XmlRootElement(name = "NetworkInterface") -public class NetworkInterfaceModel extends SampleModel { - private List networkList; - - @XmlElementWrapper - @XmlElement(name = "Instance", type = NetworkInterfaceModelChild.class) - public List getNetworkList() { - return networkList; - } - - public void setNetworkList(List networkList) { - this.networkList = networkList; - } - - public NetworkInterfaceModel() { - this.networkList = new ArrayList(); - } -} +package org.bench4q.share.models.monitor; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import org.bench4q.share.models.master.statistics.SampleModel; + +@XmlRootElement(name = "NetworkInterface") +public class NetworkInterfaceModel extends SampleModel{ + private Double kiloBytesTotalPerSecond; + private Double kiloBytesReceivedPerSecond; + private Double kiloBytesSentPerSecond; + + public NetworkInterfaceModel() { + } + + @XmlElement + public Double getKiloBytesTotalPerSecond() { + return kiloBytesTotalPerSecond; + } + + public void setKiloBytesTotalPerSecond(Double kiloBytesTotalPerSecond) { + this.kiloBytesTotalPerSecond = kiloBytesTotalPerSecond; + } + + @XmlElement + public Double getKiloBytesReceivedPerSecond() { + return kiloBytesReceivedPerSecond; + } + + public void setKiloBytesReceivedPerSecond(Double kiloBytesReceivedPerSecond) { + this.kiloBytesReceivedPerSecond = kiloBytesReceivedPerSecond; + } + + @XmlElement + public Double getKiloBytesSentPerSecond() { + return kiloBytesSentPerSecond; + } + + public void setKiloBytesSentPerSecond(Double kiloBytesSentPerSecond) { + this.kiloBytesSentPerSecond = kiloBytesSentPerSecond; + } + +} diff --git a/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModelChild.java b/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModelChild.java deleted file mode 100644 index 15c0241a..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/NetworkInterfaceModelChild.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.bench4q.share.models.monitor; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class NetworkInterfaceModelChild { -private double bytesTotalPerSecond; -private double bytesReceivedPerSecond; -private double bytesSentPerSecond; -private String instance; -public double getBytesReceivedPerSecond() { - return bytesReceivedPerSecond; -} - -public void setBytesReceivedPerSecond(double bytesReceivedPerSecond) { - this.bytesReceivedPerSecond = bytesReceivedPerSecond; -} - -public double getBytesSentPerSecond() { - return bytesSentPerSecond; -} - -public void setBytesSentPerSecond(double bytesSentPerSecond) { - this.bytesSentPerSecond = bytesSentPerSecond; -} - - -public String getInstance() { - return instance; -} - -public void setInstance(String instance) { - this.instance = instance; -} - -public double getBytesTotalPerSecond() { - return bytesTotalPerSecond; -} - -public void setBytesTotalPerSecond(double bytesTotalPerSecond) { - this.bytesTotalPerSecond = bytesTotalPerSecond; -} - -} diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/PhysicalDiskModel.java b/src/main/java/org/bench4q/share/models/monitor/PhysicalDiskModel.java similarity index 92% rename from src/main/java/org/bench4q/share/models/monitor/latest/PhysicalDiskModel.java rename to src/main/java/org/bench4q/share/models/monitor/PhysicalDiskModel.java index bd95c64a..281109b3 100644 --- a/src/main/java/org/bench4q/share/models/monitor/latest/PhysicalDiskModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/PhysicalDiskModel.java @@ -1,13 +1,15 @@ -package org.bench4q.share.models.monitor.latest; +package org.bench4q.share.models.monitor; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import org.bench4q.share.models.master.statistics.SampleModel; + import java.util.List; @XmlRootElement(name = "PhysicalDisk") -public class PhysicalDiskModel { +public class PhysicalDiskModel extends SampleModel{ private Double diskReadKBytesRate; private Double diskWriteKBytesRate; private double curDiskQueLength; diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessModel.java b/src/main/java/org/bench4q/share/models/monitor/ProcessModel.java similarity index 88% rename from src/main/java/org/bench4q/share/models/monitor/latest/ProcessModel.java rename to src/main/java/org/bench4q/share/models/monitor/ProcessModel.java index 3b7a7942..ab254c4f 100644 --- a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/ProcessModel.java @@ -1,4 +1,4 @@ -package org.bench4q.share.models.monitor.latest; +package org.bench4q.share.models.monitor; import java.util.List; @@ -6,8 +6,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import org.bench4q.share.models.master.statistics.SampleModel; + @XmlRootElement(name = "Process") -public class ProcessModel { +public class ProcessModel extends SampleModel { private List processModelList; private long[] processPids; private List processNameList; diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessModelChild.java b/src/main/java/org/bench4q/share/models/monitor/ProcessModelChild.java similarity index 88% rename from src/main/java/org/bench4q/share/models/monitor/latest/ProcessModelChild.java rename to src/main/java/org/bench4q/share/models/monitor/ProcessModelChild.java index b608aac0..cf5df0e6 100644 --- a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessModelChild.java +++ b/src/main/java/org/bench4q/share/models/monitor/ProcessModelChild.java @@ -1,10 +1,12 @@ -package org.bench4q.share.models.monitor.latest; +package org.bench4q.share.models.monitor; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import org.bench4q.share.models.master.statistics.SampleModel; + @XmlRootElement -public class ProcessModelChild { +public class ProcessModelChild extends SampleModel { private String instanceString; private long residentKBytes; private double processorTimePercent; diff --git a/src/main/java/org/bench4q/share/models/monitor/ProcessorModel.java b/src/main/java/org/bench4q/share/models/monitor/ProcessorModel.java index 4d8ba988..806e3b0b 100644 --- a/src/main/java/org/bench4q/share/models/monitor/ProcessorModel.java +++ b/src/main/java/org/bench4q/share/models/monitor/ProcessorModel.java @@ -1,30 +1,87 @@ -package org.bench4q.share.models.monitor; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.bench4q.share.models.master.statistics.SampleModel; - -@XmlRootElement(name = "Processor") -public class ProcessorModel extends SampleModel { - private List processorModelList; - - public ProcessorModel() { - processorModelList = new ArrayList(); - } - - @XmlElementWrapper - @XmlElement(name = "processorModelChild", type = ProcessorModelChild.class) - public List getProcessorModelList() { - return processorModelList; - } - - public void setProcessorModelList( - List processorModelList) { - this.processorModelList = processorModelList; - } -} +package org.bench4q.share.models.monitor; + +import java.util.List; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +import org.bench4q.share.models.master.statistics.SampleModel; + +@XmlRootElement(name = "Processors") +public class ProcessorModel extends SampleModel{ + private List processorModelList; + private double processorTimePercent; + private double privilegedTimePercent; + private double userTimePercent; + private double speed; + private List cpuInstanceList; + private int size; + + @XmlElementWrapper(name = "processorList") + @XmlElement(name = "processorInstance", type = ProcessorModelChild.class) + public List getProcessorModelList() { + return processorModelList; + } + + public void setProcessorModelList( + List processorModelList) { + this.processorModelList = processorModelList; + } + + @XmlElement + public double getProcessorTimePercent() { + return processorTimePercent; + } + + public void setProcessorTimePercent(double processorTimePercent) { + this.processorTimePercent = processorTimePercent; + } + + @XmlElement + public double getPrivilegedTimePercent() { + return privilegedTimePercent; + } + + public void setPrivilegedTimePercent(double privilegedTimePercent) { + this.privilegedTimePercent = privilegedTimePercent; + } + + @XmlElement + public double getUserTimePercent() { + return userTimePercent; + } + + public void setUserTimePercent(double userTimePercent) { + this.userTimePercent = userTimePercent; + } + + @XmlElement + public double getSpeed() { + return speed; + } + + public void setSpeed(double speed) { + this.speed = speed; + } + + @XmlElementWrapper(name = "processorNameList") + @XmlElement(name = "processorName", type = String.class) + public List getCpuInstanceList() { + return cpuInstanceList; + } + + public void setCpuInstanceList(List cpuInstanceList) { + this.cpuInstanceList = cpuInstanceList; + } + + @XmlElement + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + +} \ No newline at end of file diff --git a/src/main/java/org/bench4q/share/models/monitor/ProcessorModelChild.java b/src/main/java/org/bench4q/share/models/monitor/ProcessorModelChild.java index 2cf25fb1..b95aa7f8 100644 --- a/src/main/java/org/bench4q/share/models/monitor/ProcessorModelChild.java +++ b/src/main/java/org/bench4q/share/models/monitor/ProcessorModelChild.java @@ -1,37 +1,51 @@ package org.bench4q.share.models.monitor; +import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import org.bench4q.share.models.master.statistics.SampleModel; + @XmlRootElement -public class ProcessorModelChild { +public class ProcessorModelChild extends SampleModel{ private String instance; - private Double processorTimePercent; - private Double userTimePercent; - private Double privilegedTimePercent; - + private double processorTimePercent; + private double userTimePercent; + private double privilegedTimePercent; + + @XmlElement public String getInstance() { return instance; } + public void setInstance(String instance) { this.instance = instance; } - public Double getProcessorTimePercent() { + + @XmlElement + public double getProcessorTimePercent() { return processorTimePercent; } - public void setProcessorTimePercent(Double processorTimePercent) { + + public void setProcessorTimePercent(double processorTimePercent) { this.processorTimePercent = processorTimePercent; } - public Double getUserTimePercent() { + + @XmlElement + public double getUserTimePercent() { return userTimePercent; } - public void setUserTimePercent(Double userTimePercent) { + + public void setUserTimePercent(double userTimePercent) { this.userTimePercent = userTimePercent; } - public Double getPrivilegedTimePercent() { + + @XmlElement + public double getPrivilegedTimePercent() { return privilegedTimePercent; } - public void setPrivilegedTimePercent(Double privilegedTimePercent) { + + public void setPrivilegedTimePercent(double privilegedTimePercent) { this.privilegedTimePercent = privilegedTimePercent; } - + } diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/ListMainModel.java b/src/main/java/org/bench4q/share/models/monitor/latest/ListMainModel.java deleted file mode 100644 index cbcaf009..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/latest/ListMainModel.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.bench4q.share.models.monitor.latest; - -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "historylist") -public class ListMainModel { - private List historylist; - @XmlElementWrapper(name = "histories") - @XmlElement(name = "history", type = MainModel.class) - public List getHistorylist() { - return historylist; - } - - public void setHistorylist(List historylist) { - this.historylist = historylist; - } - -} diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/MemoryModel.java b/src/main/java/org/bench4q/share/models/monitor/latest/MemoryModel.java deleted file mode 100644 index 71d4ec67..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/latest/MemoryModel.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.bench4q.share.models.monitor.latest; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Memory") -public class MemoryModel { - private long pagesPerSecond; - private long pagesInputPerSecond; - private long pagesOutputPerSecond; - private long availableKiloBytes; - private long totalKiloBytes; - private double memoryUsedPercent; - private double swapKiloBytes; - private double swapFreeKiloBytes; - - public MemoryModel() { - } - - @XmlElement - public long getPagesPerSecond() { - return pagesPerSecond; - } - - public void setPagesPerSecond(long pagesPerSecond) { - this.pagesPerSecond = pagesPerSecond; - } - - @XmlElement - public long getPagesInputPerSecond() { - return pagesInputPerSecond; - } - - public void setPagesInputPerSecond(long pagesInputPerSecond) { - this.pagesInputPerSecond = pagesInputPerSecond; - } - - @XmlElement - public long getPagesOutputPerSecond() { - return pagesOutputPerSecond; - } - - public void setPagesOutputPerSecond(long pagesOutputPerSecond) { - this.pagesOutputPerSecond = pagesOutputPerSecond; - } - - @XmlElement - public long getAvailableKiloBytes() { - return availableKiloBytes; - } - - public void setAvailableKiloBytes(long availableKiloBytes) { - this.availableKiloBytes = availableKiloBytes; - } - - @XmlElement - public long getTotalKiloBytes() { - return totalKiloBytes; - } - - public void setTotalKiloBytes(long totalKiloBytes) { - this.totalKiloBytes = totalKiloBytes; - } - - @XmlElement - public double getMemoryUsedPercent() { - return memoryUsedPercent; - } - - public void setMemoryUsedPercent(double memoryUsedPercent) { - this.memoryUsedPercent = memoryUsedPercent; - } - - @XmlElement - public double getSwapKiloBytes() { - return swapKiloBytes; - } - - public void setSwapKiloBytes(double swapKiloBytes) { - this.swapKiloBytes = swapKiloBytes; - } - - @XmlElement - public double getSwapFreeKiloBytes() { - return swapFreeKiloBytes; - } - - public void setSwapFreeKiloBytes(double swapFreeKiloBytes) { - this.swapFreeKiloBytes = swapFreeKiloBytes; - } - -} diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/NetworkInterfaceModel.java b/src/main/java/org/bench4q/share/models/monitor/latest/NetworkInterfaceModel.java deleted file mode 100644 index 4bcafcca..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/latest/NetworkInterfaceModel.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.bench4q.share.models.monitor.latest; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "NetworkInterface") -public class NetworkInterfaceModel { - private Double kiloBytesTotalPerSecond; - private Double kiloBytesReceivedPerSecond; - private Double kiloBytesSentPerSecond; - - public NetworkInterfaceModel() { - } - - @XmlElement - public Double getKiloBytesTotalPerSecond() { - return kiloBytesTotalPerSecond; - } - - public void setKiloBytesTotalPerSecond(Double kiloBytesTotalPerSecond) { - this.kiloBytesTotalPerSecond = kiloBytesTotalPerSecond; - } - - @XmlElement - public Double getKiloBytesReceivedPerSecond() { - return kiloBytesReceivedPerSecond; - } - - public void setKiloBytesReceivedPerSecond(Double kiloBytesReceivedPerSecond) { - this.kiloBytesReceivedPerSecond = kiloBytesReceivedPerSecond; - } - - @XmlElement - public Double getKiloBytesSentPerSecond() { - return kiloBytesSentPerSecond; - } - - public void setKiloBytesSentPerSecond(Double kiloBytesSentPerSecond) { - this.kiloBytesSentPerSecond = kiloBytesSentPerSecond; - } - -} diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModel.java b/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModel.java deleted file mode 100644 index 88eac248..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModel.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.bench4q.share.models.monitor.latest; - -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Processors") -public class ProcessorModel { - private List processorModelList; - private double processorTimePercent; - private double privilegedTimePercent; - private double userTimePercent; - private double speed; - private List cpuInstanceList; - private int size; - - @XmlElementWrapper(name = "processorList") - @XmlElement(name = "processorInstance", type = ProcessorModelChild.class) - public List getProcessorModelList() { - return processorModelList; - } - - public void setProcessorModelList( - List processorModelList) { - this.processorModelList = processorModelList; - } - - @XmlElement - public double getProcessorTimePercent() { - return processorTimePercent; - } - - public void setProcessorTimePercent(double processorTimePercent) { - this.processorTimePercent = processorTimePercent; - } - - @XmlElement - public double getPrivilegedTimePercent() { - return privilegedTimePercent; - } - - public void setPrivilegedTimePercent(double privilegedTimePercent) { - this.privilegedTimePercent = privilegedTimePercent; - } - - @XmlElement - public double getUserTimePercent() { - return userTimePercent; - } - - public void setUserTimePercent(double userTimePercent) { - this.userTimePercent = userTimePercent; - } - - @XmlElement - public double getSpeed() { - return speed; - } - - public void setSpeed(double speed) { - this.speed = speed; - } - - @XmlElementWrapper(name = "processorNameList") - @XmlElement(name = "processorName", type = String.class) - public List getCpuInstanceList() { - return cpuInstanceList; - } - - public void setCpuInstanceList(List cpuInstanceList) { - this.cpuInstanceList = cpuInstanceList; - } - - @XmlElement - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - -} \ No newline at end of file diff --git a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModelChild.java b/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModelChild.java deleted file mode 100644 index 60e48304..00000000 --- a/src/main/java/org/bench4q/share/models/monitor/latest/ProcessorModelChild.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.bench4q.share.models.monitor.latest; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class ProcessorModelChild { - private String instance; - private double processorTimePercent; - private double userTimePercent; - private double privilegedTimePercent; - - @XmlElement - public String getInstance() { - return instance; - } - - public void setInstance(String instance) { - this.instance = instance; - } - - @XmlElement - public double getProcessorTimePercent() { - return processorTimePercent; - } - - public void setProcessorTimePercent(double processorTimePercent) { - this.processorTimePercent = processorTimePercent; - } - - @XmlElement - public double getUserTimePercent() { - return userTimePercent; - } - - public void setUserTimePercent(double userTimePercent) { - this.userTimePercent = userTimePercent; - } - - @XmlElement - public double getPrivilegedTimePercent() { - return privilegedTimePercent; - } - - public void setPrivilegedTimePercent(double privilegedTimePercent) { - this.privilegedTimePercent = privilegedTimePercent; - } - -}