Class LatencyObjective

java.lang.Object
com.eqixiac.equinix.design.objective.LatencyObjective
All Implemented Interfaces:
Objective

public final class LatencyObjective extends Object implements Objective
Site-weighted round-trip latency from each site to its nearest metro in the portfolio, in ms. Sites whose latency to every portfolio metro is unknown are left out and the weights of the rest renormalised; the explanation names them, the worst-case site, and whether its figure is measured. Unknown when no site latency is known.
  • Field Details

    • DEFAULT_WORST_ROUND_TRIP_MS

      public static final double DEFAULT_WORST_ROUND_TRIP_MS
      The round trip that scores 0 when the spec states no latency ceiling, in ms.
      See Also:
  • Constructor Details

    • LatencyObjective

      public LatencyObjective()
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface Objective
      Returns:
      the id weights refer to (for example Objective.LATENCY); stable, lower_snake_case
    • direction

      public Direction direction()
      Specified by:
      direction in interface Objective
      Returns:
      whether smaller or larger values are better
    • scale

      public ValueScale scale(DesignContext context)
      A fixed scale: 0 ms scores 100 and the spec's latency ceiling scores 0, or 200.0 ms round trip when the spec states none (an SDK assumption: about where interactive traffic stops feeling local). A few milliseconds therefore cost a few points, whatever other options are in the set.
      Specified by:
      scale in interface Objective
      Parameters:
      context - the facts of this run
      Returns:
      the scale
    • unit

      public String unit()
      Specified by:
      unit in interface Objective
      Returns:
      the unit of ObjectiveValue.value(), for display (for example ms, USD/month, score)
    • evaluate

      public ObjectiveValue evaluate(MetroPortfolio portfolio, DesignContext context)
      Description copied from interface: Objective
      Measures a portfolio.
      Specified by:
      evaluate in interface Objective
      Parameters:
      portfolio - the metros of one candidate design
      context - the facts of this run
      Returns:
      the measurement, or ObjectiveValue.unknown(String) when it cannot be made