@Override public void addStateHistoryEntry(final VmStateHistoryEntry entry) { if (!stateHistory.isEmpty()) { final VmStateHistoryEntry previousState = stateHistory.get(stateHistory.size() - 1); if (previousState.getTime() == entry.getTime()) { stateHistory.set(stateHistory.size() - 1, entry); return; } } stateHistory.add(entry); }
/** * Instantiates a new VmStateHistoryEntry * * @param time the time * @param allocatedMips the allocated mips * @param requestedMips the requested mips * @param inMigration the is in migration */ public VmStateHistoryEntry(double time, double allocatedMips, double requestedMips, boolean inMigration) { setTime(time); setAllocatedMips(allocatedMips); setRequestedMips(requestedMips); setInMigration(inMigration); }
private double getVmRequestedMips(Cloudlet c) { if(c.getVm().getStateHistory().isEmpty()){ return 0; } return c.getVm().getStateHistory().get(c.getVm().getStateHistory().size()-1).getRequestedMips(); }
private double getVmAllocatedMips(Cloudlet c) { if(c.getVm().getStateHistory().isEmpty()){ return 0; } return c.getVm().getStateHistory().get(c.getVm().getStateHistory().size()-1).getAllocatedMips(); }
final VmStateHistoryEntry entry = new VmStateHistoryEntry( currentTime, totalAllocatedMips,