From 22026feff64d2b6bc518c48ec1cbc2aade662a05 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 26 Feb 2024 15:52:35 +0100 Subject: [PATCH] worker: add logging --- worker/memory.go | 2 ++ worker/mocks_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/worker/memory.go b/worker/memory.go index 8b1c7cb5e1..ffcbffdf21 100644 --- a/worker/memory.go +++ b/worker/memory.go @@ -95,6 +95,7 @@ func (mm *memoryManager) AcquireMemory(ctx context.Context, amt uint64) Memory { mm.sigNewMem.Signal() // wake next goroutine mm.sigNewMem.L.Unlock() + fmt.Println("DEBUG PJ: acquired memory", amt) return &acquiredMemory{ mm: mm, remaining: amt, @@ -152,6 +153,7 @@ func (lmm *limitMemoryManager) AcquireMemory(ctx context.Context, amt uint64) Me return nil } + fmt.Println("DEBUG PJ: acquired limit memory", amt) return &limitAcquiredMemory{ child: childMem, parent: parentMem, diff --git a/worker/mocks_test.go b/worker/mocks_test.go index 8406bd3d22..474b0b7767 100644 --- a/worker/mocks_test.go +++ b/worker/mocks_test.go @@ -338,7 +338,9 @@ func (mm *memoryManagerMock) Limit(amt uint64) (MemoryManager, error) { func (mm *memoryManagerMock) Status() api.MemoryStatus { return api.MemoryStatus{} } func (mm *memoryManagerMock) AcquireMemory(ctx context.Context, amt uint64) Memory { + start := time.Now() <-mm.memBlockChan + fmt.Println("DEBUG PJ: acquired mock memory", amt, time.Since(start)) return &memoryMock{} }