From 61c29263c0b532c3d58ae773c9a944fb175d0ad0 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 24 Oct 2023 09:29:51 -0400 Subject: [PATCH] fix oom time metric (#3947) --- sim/core/apl.go | 2 +- sim/core/gcd.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sim/core/apl.go b/sim/core/apl.go index 7b0f568cab..88741763e5 100644 --- a/sim/core/apl.go +++ b/sim/core/apl.go @@ -215,7 +215,7 @@ func (apl *APLRotation) DoNextAction(sim *Simulation) { apl.unit.DoNothing() } - apl.unit.DoneAPLLoop(sim, gcdReady) + apl.unit.DoneAPLLoop(sim, !gcdReady) } func (apl *APLRotation) getNextAction(sim *Simulation) *APLAction { diff --git a/sim/core/gcd.go b/sim/core/gcd.go index 6741047306..b6a08c02fe 100644 --- a/sim/core/gcd.go +++ b/sim/core/gcd.go @@ -110,7 +110,9 @@ func (unit *Unit) WaitUntil(sim *Simulation, readyTime time.Duration) { if readyTime < sim.CurrentTime { panic(unit.Label + ": cannot wait negative time") } - unit.waitStartTime = sim.CurrentTime + if !unit.IsWaiting() { + unit.waitStartTime = sim.CurrentTime + } unit.SetGCDTimer(sim, readyTime) if sim.Log != nil && readyTime > sim.CurrentTime { unit.Log(sim, "Pausing GCD for %s due to rotation / CDs.", readyTime-sim.CurrentTime)