Class ResilienceAnalyzer

java.lang.Object
com.eqixiac.equinix.design.resilience.ResilienceAnalyzer

public final class ResilienceAnalyzer extends Object
Analyses how a design survives failures: builds its DesignGraph, simulates every single failure (exhaustively) and pairs of failures (bounded), ranks the blast radius, finds single points of failure and correlated risks, estimates availability and proposes remediation, re-simulating it where it can.
// Live (read-only): load the Fabric catalogue, run the optimiser, analyse its recommendation
ResilienceReport report = ResilienceAnalyzer.forSpec(fabric, spec).run();
System.out.println(report.toMarkdown());

// An explicit portfolio, or an optimiser result you already have
ResilienceAnalyzer.forSpec(fabric, spec).portfolio(MetroPortfolio.ofCodes("DC", "NY")).run();
ResilienceAnalyzer.forSpec(fabric, spec).optimization(result).run();

// Offline, over facts you already hold (tests, cached catalogue, what-ifs)
ResilienceAnalyzer.forContext(catalogContext).run();

Read-only: it never creates, changes or deletes anything. Without an explicit portfolio, the portfolio is the Metro Optimizer's recommendation for the spec; with a CatalogDesignContext this needs no network, otherwise the optimiser prices with RateCard.standardChain(fabric) unless a rateCard(RateCard) is given.

  • Method Details

    • forSpec

      public static ResilienceAnalyzer forSpec(FabricGateway fabric, DesignSpec spec)
      Analyses a spec against live Fabric data (read-only).
      Parameters:
      fabric - the Fabric API
      spec - the design
      Returns:
      an analysis to configure and run()
    • forContext

      public static ResilienceAnalyzer forContext(DesignContext context)
      Analyses over facts already gathered (no network unless the optimiser has to price and the context has no cost model).
      Parameters:
      context - the facts; its spec is the design
      Returns:
      an analysis to configure and run()
    • portfolio

      public ResilienceAnalyzer portfolio(MetroPortfolio metros)
      Parameters:
      metros - the portfolio to analyse instead of the optimiser's recommendation
      Returns:
      this analysis
    • optimization

      public ResilienceAnalyzer optimization(OptimizationResult result)
      Parameters:
      result - an optimiser result whose recommended portfolio is analysed (it must be for the same spec)
      Returns:
      this analysis
    • rateCard

      public ResilienceAnalyzer rateCard(RateCard card)
      Parameters:
      card - the rate card the optimiser prices with when it has to run
      Returns:
      this analysis
    • options

      public ResilienceAnalyzer options(ResilienceOptions resilienceOptions)
      Parameters:
      resilienceOptions - graph and simulation options
      Returns:
      this analysis
    • peering

      Parameters:
      result - a peering analysis whose presence is drawn into the graph as peer nodes
      Returns:
      this analysis
    • run

      public ResilienceReport run()
      Runs the analysis.
      Returns:
      the report
      Throws:
      IllegalArgumentException - when the spec has errors, the optimisation result belongs to another spec, or nothing is feasible to analyse
    • analyze

      public static ResilienceReport analyze(DesignContext context, MetroPortfolio metros, ResilienceOptions options)
      The analysis itself, pure: no I/O, deterministic apart from timingsMs.
      Parameters:
      context - the facts (its spec is the design)
      metros - the portfolio
      options - options; null for the defaults
      Returns:
      the report