Fix the bug of LogicalDiskServicewindows and LogicalDiskTest
This commit is contained in:
parent
d694d00563
commit
964dd3185b
|
@ -24,7 +24,8 @@ public class LogicalDiskServiceWindows {
|
|||
|
||||
public LogicalDiskModel getLogicalDiskInfo(int idleTime){
|
||||
|
||||
String[] instances;
|
||||
|
||||
String []temp;
|
||||
Map<String,Double> freeSpacePercent=new HashMap<String, Double>();
|
||||
Map<String,Double> freeMegabytes=new HashMap<String, Double>();
|
||||
|
||||
|
@ -49,8 +50,12 @@ public class LogicalDiskServiceWindows {
|
|||
// µ±Ç°¶ÓÁ㤶È
|
||||
Map<String,Double> currentDiskQueueLength=new HashMap<String, Double>();
|
||||
|
||||
instances=this.getLogicalDiskMonitor().getInstances();
|
||||
temp=this.getLogicalDiskMonitor().getInstances();
|
||||
String[] instances=new String[temp.length-1];
|
||||
for(int i=0;i<temp.length-1;i++)
|
||||
instances[i]=temp[i];
|
||||
for(String elem:instances){
|
||||
|
||||
freeSpacePercent.put(elem, this.getLogicalDiskMonitor().getFreeSpacePercent(elem));
|
||||
freeMegabytes.put(elem, this.getLogicalDiskMonitor().getFreeSpacePercent(elem));
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class LogicalDiskTest {
|
|||
String urlString = "http://localhost:5555/Monitor/LogicalDisk";
|
||||
atx = new ClassPathXmlApplicationContext("org/Bench4Q/Monitor/Config/application-context.xml");
|
||||
|
||||
LogicalDiskTest monitorServiceTest =(LogicalDiskTest)atx.getBean("monitorServiceTest");
|
||||
LogicalDiskTest monitorServiceTest =(LogicalDiskTest)atx.getBean("logicalDiskTest");
|
||||
|
||||
try {
|
||||
|
||||
|
@ -89,6 +89,13 @@ public class LogicalDiskTest {
|
|||
+ logicalDiskModel.getAverageDiskBytesPerRead().get(elem));
|
||||
System.out.println("averageDiskBytesPerWrite" + ": "
|
||||
+ logicalDiskModel.getAverageDiskBytesPerWrite().get(elem));
|
||||
System.out.println("idelTimePercent"+":"+logicalDiskModel.getIdleTimePercent().get(elem));
|
||||
System.out.println("averageDiskQueueLength"+":"+logicalDiskModel.getAverageDiskQueueLength().get(elem));
|
||||
System.out.println("currentDiskQueueLength"+":"+logicalDiskModel.getCurrentDiskQueueLength().get(elem));
|
||||
// ƽ¾ù¶ÓÁ㤶È
|
||||
|
||||
// µ±Ç°¶ÓÁ㤶È
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue