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

java.lang.Object
  extended by com.atlassian.bamboo.agent.elastic.schedule.ElasticRunningInstancesOptimizerImpl
All Implemented Interfaces:
ElasticRunningInstancesOptimizer

public class ElasticRunningInstancesOptimizerImpl
extends Object
implements ElasticRunningInstancesOptimizer


Constructor Summary
ElasticRunningInstancesOptimizerImpl(BuildQueueManager buildQueueManager, AgentManager agentManager, CachedPlanManager cachedPlanManager, ElasticInstanceManager elasticInstanceManager, ElasticAccountBean elasticAccountBean, BuildExecutionManager buildExecutionManager, BambooLicenseManager bambooLicenseManager, ResultsSummaryManager resultsSummaryManager, AdministrationConfigurationAccessor administrationConfigurationAccessor, com.opensymphony.xwork2.TextProvider textProvider, AwsAccountBean awsAccountBean, ExecutableAgentsHelper executableAgentsHelper, EnvironmentService environmentService, DeploymentResultService deploymentResultService)
           
 
Method Summary
 Collection<RemoteElasticInstance> getAgentsToStop()
          Returns a collection of currently running elastic agents that should be stopped.
 Collection<ElasticImageConfiguration> getImagesToStart()
          Which and how many elastic images should be started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticRunningInstancesOptimizerImpl

public ElasticRunningInstancesOptimizerImpl(BuildQueueManager buildQueueManager,
                                            AgentManager agentManager,
                                            CachedPlanManager cachedPlanManager,
                                            ElasticInstanceManager elasticInstanceManager,
                                            ElasticAccountBean elasticAccountBean,
                                            BuildExecutionManager buildExecutionManager,
                                            BambooLicenseManager bambooLicenseManager,
                                            ResultsSummaryManager resultsSummaryManager,
                                            AdministrationConfigurationAccessor administrationConfigurationAccessor,
                                            com.opensymphony.xwork2.TextProvider textProvider,
                                            AwsAccountBean awsAccountBean,
                                            ExecutableAgentsHelper executableAgentsHelper,
                                            EnvironmentService environmentService,
                                            DeploymentResultService deploymentResultService)
Method Detail

getImagesToStart

@NotNull
public Collection<ElasticImageConfiguration> getImagesToStart()
Description copied from interface: ElasticRunningInstancesOptimizer
Which and how many elastic images should be started.

Specified by:
getImagesToStart in interface ElasticRunningInstancesOptimizer
Returns:

getAgentsToStop

@NotNull
public Collection<RemoteElasticInstance> getAgentsToStop()
Description copied from interface: ElasticRunningInstancesOptimizer
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_THRESHOLD - in the last 10 minutes of full running hour (instances are paid in one hour increments)

Specified by:
getAgentsToStop in interface ElasticRunningInstancesOptimizer
Returns:
list of elastic instances that cannot run any of the builds currently in queue


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.