Class 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:
  • Field Details

    • DEFAULT_IDLE_TIMEOUT_MINUTES

      public static final int DEFAULT_IDLE_TIMEOUT_MINUTES
      Also the window a quiet label takes to give up one step of its spare target.
      See Also:
  • Constructor Details

    • HotSpareConfigByLabel

      @DataBoundConstructor public HotSpareConfigByLabel(String label)
  • Method Details

    • getLabel

      public String 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

      @CheckForNull public Integer getMaxHotSpares()
      Returns:
      the ceiling on spares held by the whole label group, or null for no ceiling.
    • setMaxHotSpares

      @DataBoundSetter public void setMaxHotSpares(Integer maxHotSpares)
    • 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)