Class MinSurvivalConstraint
java.lang.Object
com.eqixiac.equinix.design.resilience.MinSurvivalConstraint
- All Implemented Interfaces:
Constraint
"min_survival": a portfolio must keep at least a minimum share of its baseline service through its worst
single-element failure (see
N1Survival). Opt-in: with no threshold the constraint passes
everything without simulating.
The threshold, a percentage 0..100, comes from (first that is set wins): the constructor; the spec's
constraints.minSurvivalPct; the spec label "design.min_survival_pct" (for example
labels: {"design.min_survival_pct": "75"}). The label is the older, schema-free way to opt in and
keeps working; when both are set the constraints.minSurvivalPct field wins. A malformed label fails
every portfolio with a reason rather than being ignored. The Metro Optimizer adds this constraint itself when
the spec sets constraints.minSurvivalPct, so the field never needs the ResiliencePlugin.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReads the threshold from the spec (constraints.minSurvivalPct, else the label "design.min_survival_pct"); inert without either.MinSurvivalConstraint(Double thresholdPct, ResilienceOptions options) -
Method Summary
Modifier and TypeMethodDescriptioncheck(MetroPortfolio portfolio, DesignContext context) Checks a whole portfolio.id()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Constraint
admits, usesCostModifier and TypeMethodDescriptiondefault booleanadmits(MetroFacts metro, DesignContext context) Cheap per-metro pruning before portfolios are formed.default booleanusesCost()WhetherConstraint.check(MetroPortfolio, DesignContext)prices the portfolio throughDesignContext.costModel().
-
Field Details
-
ID
-
LABEL
The spec label that sets the threshold (a percentage, 0..100).- See Also:
-
-
Constructor Details
-
MinSurvivalConstraint
public MinSurvivalConstraint()Reads the threshold from the spec (constraints.minSurvivalPct, else the label "design.min_survival_pct"); inert without either. -
MinSurvivalConstraint
- Parameters:
thresholdPct- the least share of service that must survive, 0..100;nullto read the spec (constraints.minSurvivalPct, else the label "design.min_survival_pct")options- graph and simulation options
-
-
Method Details
-
id
- Specified by:
idin interfaceConstraint- Returns:
- a stable id, lower_snake_case (for example
max_latency)
-
check
Description copied from interface:ConstraintChecks a whole portfolio.- Specified by:
checkin interfaceConstraint- Parameters:
portfolio- the candidate designcontext- the facts of this run- Returns:
- the verdict with its reason
-