mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-1868. GetVmStatsCommand throws NullPointerException with VMWare.
This commit is contained in:
parent
278ef81a83
commit
273c912bb6
@ -6526,6 +6526,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
|
||||
for(int i=0; i<values.size(); ++i) {
|
||||
List<PerfSampleInfo> infos = ((PerfEntityMetric)values.get(i)).getSampleInfo();
|
||||
if (infos != null && infos.size() > 0) {
|
||||
int endMs = infos.get(infos.size()-1).getTimestamp().getSecond() * 1000 + infos.get(infos.size()-1).getTimestamp().getMillisecond();
|
||||
int beginMs = infos.get(0).getTimestamp().getSecond() * 1000 + infos.get(0).getTimestamp().getMillisecond();
|
||||
sampleDuration = (endMs - beginMs) /1000;
|
||||
@ -6544,6 +6545,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vmResponseMap.put(name, new VmStatsEntry(Integer.parseInt(maxCpuUsage), networkReadKBs, networkWriteKBs, Integer.parseInt(numberCPUs), "vm"));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user