Package hudson.plugins.ec2
Class HotSpareConfigByLabel
java.lang.Object
hudson.model.AbstractDescribableImpl<HotSpareConfigByLabel>
hudson.plugins.ec2.HotSpareConfigByLabel
- All Implemented Interfaces:
Describable<HotSpareConfigByLabel>,Serializable
public class HotSpareConfigByLabel
extends AbstractDescribableImpl<HotSpareConfigByLabel>
implements Serializable
Hot spare scaling for one Jenkins label, across every
SlaveTemplate of a cloud that
carries that label.
Templates sharing a label are treated as interchangeable hardware, so the numbers here apply
to the group as a whole: getMaxHotSpares() caps the spares held by all of those
templates combined, not each of them. A matching rule supersedes
SlaveTemplate.getMinimumNumberOfSpareInstances() for those templates, because owning the
spare count for the label is the point of the rule.
The idle timeout and grace period configured here also win over the template values by
default. Ticking the corresponding allowTemplate...Override box gives precedence back to
templates that set the value explicitly.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAlso the window a quiet label takes to give up one step of its spare target. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintgetLabel()intbooleanbooleanbooleanvoidsetAllowTemplateGracePeriodOverride(boolean allowTemplateGracePeriodOverride) voidsetAllowTemplateIdleTimeoutOverride(boolean allowTemplateIdleTimeoutOverride) voidsetBaseHotSpares(int baseHotSpares) voidsetDiscardAfterGracePeriod(boolean discardAfterGracePeriod) voidsetGracePeriodMinutes(int gracePeriodMinutes) voidsetIdleTimeoutMinutes(int idleTimeoutMinutes) voidsetMaxHotSpares(Integer maxHotSpares) voidsetScalingFactor(int scalingFactor) Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Field Details
-
DEFAULT_IDLE_TIMEOUT_MINUTES
public static final int DEFAULT_IDLE_TIMEOUT_MINUTESAlso the window a quiet label takes to give up one step of its spare target.- See Also:
-
-
Constructor Details
-
HotSpareConfigByLabel
-
-
Method Details
-
getLabel
-
getScalingFactor
public int getScalingFactor()- Returns:
- the amount the spare target moves by when the label cannot keep up with the work arriving, and the amount it gives back when the spares go unused.
- See Also:
-
setScalingFactor
@DataBoundSetter public void setScalingFactor(int scalingFactor) -
getBaseHotSpares
public int getBaseHotSpares()- Returns:
- the number of spares to keep warm for this label at all times, which is also the floor the target decays to once the label goes quiet.
-
setBaseHotSpares
@DataBoundSetter public void setBaseHotSpares(int baseHotSpares) -
getMaxHotSpares
- Returns:
- the ceiling on spares held by the whole label group, or
nullfor no ceiling.
-
setMaxHotSpares
-
getIdleTimeoutMinutes
public int getIdleTimeoutMinutes()- Returns:
- idle termination for agents of this label, in minutes. 0 means never.
-
setIdleTimeoutMinutes
@DataBoundSetter public void setIdleTimeoutMinutes(int idleTimeoutMinutes) -
getGracePeriodMinutes
public int getGracePeriodMinutes()- Returns:
- minutes an agent of this label is given to come online, or 0 for no grace period.
-
setGracePeriodMinutes
@DataBoundSetter public void setGracePeriodMinutes(int gracePeriodMinutes) -
isDiscardAfterGracePeriod
public boolean isDiscardAfterGracePeriod() -
setDiscardAfterGracePeriod
@DataBoundSetter public void setDiscardAfterGracePeriod(boolean discardAfterGracePeriod) -
isAllowTemplateIdleTimeoutOverride
public boolean isAllowTemplateIdleTimeoutOverride()- Returns:
- whether a template that sets its own idle termination time takes precedence over this rule. A template that leaves it blank still follows the rule.
-
setAllowTemplateIdleTimeoutOverride
@DataBoundSetter public void setAllowTemplateIdleTimeoutOverride(boolean allowTemplateIdleTimeoutOverride) -
isAllowTemplateGracePeriodOverride
public boolean isAllowTemplateGracePeriodOverride()- Returns:
- whether a template that sets its own grace period takes precedence over this rule. A template that leaves it at 0 still follows the rule.
-
setAllowTemplateGracePeriodOverride
@DataBoundSetter public void setAllowTemplateGracePeriodOverride(boolean allowTemplateGracePeriodOverride)
-