use of com.cloud.agent.api.VmStatsEntry in project cloudstack by apache.
the class MockVmManagerImpl method getVmStats.
@Override
public Answer getVmStats(final GetVmStatsCommand cmd) {
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");
// default values 256 KBps
entry.setNetworkReadKBs(32768);
entry.setNetworkWriteKBs(16384);
entry.setCPUUtilization(10);
entry.setNumCPUs(1);
vmStatsNameMap.put(vmName, entry);
}
return new GetVmStatsAnswer(cmd, vmStatsNameMap);
}
Aggregations