com.atlassian.bamboo.agent.elastic.schedule
Class ElasticRunningInstancesOptimizer

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.schedule.ElasticRunningInstancesOptimizer

public class ElasticRunningInstancesOptimizer
extends java.lang.Object

Class is responsible for determining what elastic images and how many of them need to be started to speed up queue processing. It also checks what elastic instances can be shutdown without impacting the queue processing.

Author:
anatoli

Constructor Summary
ElasticRunningInstancesOptimizer(BuildQueueManager buildQueueManager, LocalAgentManager agentManager, PlanManager planManager, ElasticInstanceManager elasticInstanceManager, ElasticAccountBean elasticAccountBean, BuildExecutionManager buildExecutionManager, BambooLicenseManager bambooLicenseManager, BuildResultsSummaryManager buildResultsSummaryManager, AdministrationConfigurationManager administrationConfigurationManager, com.opensymphony.xwork.TextProvider textProvider)
           
 
Method Summary
 java.util.Collection<ElasticImageConfiguration> getImagesToStart()
           
 java.util.Collection<RemoteElasticInstance> getInstancesToStop()
          Returns a collection of currently running elastic agents that should be stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticRunningInstancesOptimizer

public ElasticRunningInstancesOptimizer(BuildQueueManager buildQueueManager,
                                        LocalAgentManager agentManager,
                                        PlanManager planManager,
                                        ElasticInstanceManager elasticInstanceManager,
                                        ElasticAccountBean elasticAccountBean,
                                        BuildExecutionManager buildExecutionManager,
                                        BambooLicenseManager bambooLicenseManager,
                                        BuildResultsSummaryManager buildResultsSummaryManager,
                                        AdministrationConfigurationManager administrationConfigurationManager,
                                        com.opensymphony.xwork.TextProvider textProvider)
Method Detail

getImagesToStart

public java.util.Collection<ElasticImageConfiguration> getImagesToStart()

getInstancesToStop

public java.util.Collection<RemoteElasticInstance> getInstancesToStop()
Returns a collection of currently running elastic agents that should be stopped. Current implementation returns the list of elastic instances that - cannot run any of the builds currently in queue - have been idle for longer than ELASTIC_AGENT_IDLE_THREASHOLD - in the last 10 minutes of full running hour (instances are paid in one hour increments)

Returns:
list of elastic instances that cannot run any of the builds currently in queue


Copyright © 2010 Atlassian. All Rights Reserved.