Skip to content

Commit

Permalink
worker: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Feb 26, 2024
1 parent fe828e2 commit 22026fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions worker/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions worker/mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}

Expand Down

0 comments on commit 22026fe

Please sign in to comment.