From 7a3dc29a37c0b6dd0cd2b8162e024b5de4d8f1d8 Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Mon, 23 Jun 2025 18:36:40 -0700 Subject: [PATCH] Add loadbalancer to translation logic and GetQueue to the simulation node interface --- internal/simulation/engine.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/simulation/engine.go b/internal/simulation/engine.go index edee4a7..574e5a5 100644 --- a/internal/simulation/engine.go +++ b/internal/simulation/engine.go @@ -23,6 +23,7 @@ type SimulationNode interface { Emit() []*Request IsAlive() bool GetTargets() []string + GetQueue() []*Request } type Engine struct { @@ -57,6 +58,16 @@ func NewEngineFromDesign(design design.Design, duration int, tickMs int) *Engine Alive: true, Queue: []*Request{}, } + case "loadBalancer": + props := n.Props + simNode = &LoadBalancerNode{ + ID: n.ID, + Label: asString(props["label"]), + Algorithm: asString(props["algorithm"]), + Queue: []*Request{}, + Alive: true, + Targets: []string{}, + } case "cache": simNode = &CacheNode{ ID: n.ID,