mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 8643: listCapacityCmd - Make the capacity calculation more optimal. Now the API wont recalculate the stats everytime its called. It would rely on the capacity checker thread running (configurable) every 5 mins to get the capacity. Change the initital delay of capacity check thread from 5 mins to 30 seconds so that we check capacity immediately as we log in.
status 8643: resolved fixed
This commit is contained in:
parent
126a863777
commit
f85ef91a8d
4
server/src/com/cloud/alert/AlertManagerImpl.java
Normal file → Executable file
4
server/src/com/cloud/alert/AlertManagerImpl.java
Normal file → Executable file
@ -80,7 +80,7 @@ import com.sun.mail.smtp.SMTPTransport;
|
||||
public class AlertManagerImpl implements AlertManager {
|
||||
private static final Logger s_logger = Logger.getLogger(AlertManagerImpl.class.getName());
|
||||
|
||||
private static final long INITIAL_DELAY = 5L * 60L * 1000L; // five minutes expressed in milliseconds
|
||||
private static final long INITIAL_CAPACITY_CHECK_DELAY = 30L * 1000L; // five minutes expressed in milliseconds
|
||||
|
||||
private static final DecimalFormat _dfPct = new DecimalFormat("###.##");
|
||||
private static final DecimalFormat _dfWhole = new DecimalFormat("########");
|
||||
@ -201,7 +201,7 @@ public class AlertManagerImpl implements AlertManager {
|
||||
|
||||
@Override
|
||||
public boolean start() {
|
||||
_timer.schedule(new CapacityChecker(), INITIAL_DELAY, _capacityCheckPeriod);
|
||||
_timer.schedule(new CapacityChecker(), INITIAL_CAPACITY_CHECK_DELAY, _capacityCheckPeriod);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -3151,7 +3151,6 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
// NOTE: listCapacities is currently called by the UI only, so this
|
||||
// shouldn't be called much since it checks all hosts/VMs
|
||||
// to figure out what has been allocated.
|
||||
_alertMgr.recalculateCapacity();
|
||||
|
||||
Filter searchFilter = new Filter(CapacityVO.class, "capacityType", true, cmd.getStartIndex(), cmd.getPageSizeVal());
|
||||
SearchCriteria<CapacityVO> sc = _capacityDao.createSearchCriteria();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user