Class CatalogDesignContext

java.lang.Object
com.eqixiac.equinix.design.optimizer.context.CatalogDesignContext
All Implemented Interfaces:
DesignContext

public final class CatalogDesignContext extends Object implements DesignContext
The DesignContext of one Metro Optimizer run: the metro catalogue, Fabric's measured metro-to-metro round trips, cloud reachability per metro and the cost model, held in memory and never changed after CatalogDesignContext.Builder.build().

Built from live Fabric data by FabricCatalogLoader, or directly with builder(DesignSpec) (tests, offline what-ifs, a cached catalogue).

Latency rules (all round trip)

  1. A site that names a metro, to that same metro: 0.5 ms, an assumption (LatencyFigure.Basis.INTRA_METRO).
  2. A site that names a metro, to a metro Fabric measures it against: the measurement (LatencyFigure.Basis.MEASURED).
  3. Otherwise, when both ends have coordinates (the site's own, else its metro's): the straight-fibre floor times the calibrated route factor (LatencyFigure.Basis.ESTIMATED).
  4. Otherwise unknown.

Site weights

A site's raw weight is its explicit weight; else its headcount times its role's importance multiplier (1.0 without a role); else, when it has neither, its role multiplier (1.0 without a role) times the mean raw weight of the sites that do carry one (1 when none does), that is, "an average site for its role". Raw weights are normalised to sum to 1. siteWeightingNotes() names every site whose weight was inferred.

  • Field Details

    • INTRA_METRO_RTT_MS

      public static final double INTRA_METRO_RTT_MS
      Round trip assumed between a site and the metro it names (no Fabric figure exists for it).
      See Also:
  • Method Details

    • builder

      public static CatalogDesignContext.Builder builder(DesignSpec spec)
      Parameters:
      spec - the design the context describes
      Returns:
      an empty builder
    • spec

      public DesignSpec spec()
      Specified by:
      spec in interface DesignContext
      Returns:
      the design being evaluated
    • metros

      public List<MetroFacts> metros()
      Specified by:
      metros in interface DesignContext
      Returns:
      every metro the catalogue returned, in a stable order (by code)
    • metro

      public Optional<MetroFacts> metro(MetroId metro)
      Specified by:
      metro in interface DesignContext
      Parameters:
      metro - a metro
      Returns:
      its facts, or empty when the catalogue does not list it
    • roundTripLatencyMs

      public OptionalDouble roundTripLatencyMs(MetroId metro, SiteIntent site)
      Description copied from interface: DesignContext
      Round-trip latency between a metro and a site: Fabric's measurement when the site names a metro and the pair is measured, otherwise an estimate from distance, otherwise unknown.
      Specified by:
      roundTripLatencyMs in interface DesignContext
      Parameters:
      metro - a metro
      site - a site of the spec
      Returns:
      the latency in ms, or empty when it is unknown
    • latencyMeasured

      public boolean latencyMeasured(MetroId metro, SiteIntent site)
      Specified by:
      latencyMeasured in interface DesignContext
      Parameters:
      metro - a metro
      site - a site of the spec
      Returns:
      true when DesignContext.roundTripLatencyMs(MetroId, SiteIntent) is a Fabric measurement, false when it is an estimate or unknown
    • roundTripLatencyMs

      public OptionalDouble roundTripLatencyMs(MetroId a, MetroId b)
      Description copied from interface: DesignContext
      Round-trip latency between two metros, measured where Fabric publishes it and estimated otherwise.
      Specified by:
      roundTripLatencyMs in interface DesignContext
      Parameters:
      a - one metro
      b - the other metro
      Returns:
      the latency in ms, or empty when it is unknown
    • latency

      public LatencyFigure latency(MetroId metro, SiteIntent site)
      Round trip from a metro to a site, with its basis. See the class description for the rules.
      Parameters:
      metro - a metro
      site - a site of the spec
      Returns:
      the figure; LatencyFigure.Basis.UNKNOWN when it cannot be known
    • latency

      public LatencyFigure latency(MetroId a, MetroId b)
      Round trip between two metros with its basis: the same metro is 0.5 ms (assumed), a measured pair is Fabric's figure, otherwise a calibrated estimate, otherwise unknown.
      Parameters:
      a - one metro
      b - the other metro
      Returns:
      the figure
    • siteWeight

      public double siteWeight(SiteIntent site)
      Specified by:
      siteWeight in interface DesignContext
      Parameters:
      site - a site of the spec
      Returns:
      the site's share of the total site weight, between 0 and 1 (weights sum to 1 across sites)
    • reachableClouds

      public Set<String> reachableClouds(MetroId metro)
      Specified by:
      reachableClouds in interface DesignContext
      Parameters:
      metro - a metro
      Returns:
      the ids of the spec's CloudIntents that can be reached privately from the metro
    • providerAvailability

      public Map<String, ProviderAvailability> providerAvailability(MetroId metro)
      Parameters:
      metro - a metro
      Returns:
      the service profile chosen per cloud id at that metro (only clouds reachable there)
    • costModel

      public CostModel costModel()
      Specified by:
      costModel in interface DesignContext
      Returns:
      the cost model that prices portfolios in this run
    • asOf

      public Instant asOf()
      Specified by:
      asOf in interface DesignContext
      Returns:
      when the facts were gathered
    • calibration

      public RouteFactorCalibration calibration()
      Returns:
      the route factor used for unmeasured pairs and what it was fitted from
    • dataNotes

      public List<String> dataNotes()
      Returns:
      how the facts were gathered and how complete they are (catalogue scans, unresolved clouds)
    • siteWeightingNotes

      public List<String> siteWeightingNotes()
      Returns:
      statements naming every site whose weight was inferred, and how
    • measuredPairCount

      public int measuredPairCount()
      Returns:
      how many metro pairs Fabric measures in this catalogue
    • withCostModel

      public CatalogDesignContext withCostModel(CostModel model)
      A copy of this context with another cost model (the facts are shared).
      Parameters:
      model - the cost model
      Returns:
      the new context