Skip to content

Commit

Permalink
Add more logging for resources
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Oct 4, 2024
1 parent 7627c13 commit 0df6eec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions harmony/harmonytask/harmonytask.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,15 @@ func (e *TaskEngine) pollerTryAllWork() bool {
// ResourcesAvailable determines what resources are still unassigned.
func (e *TaskEngine) ResourcesAvailable() resources.Resources {
tmp := e.reg.Resources
llog := log.With("Resource availability Check")
for _, t := range e.handlers {
ct := t.Max.ActiveThis()
tmp.Cpu -= ct * t.Cost.Cpu
tmp.Gpu -= float64(ct) * t.Cost.Gpu
tmp.Ram -= uint64(ct) * t.Cost.Ram
llog.Infow("Per task type", "Name", t.Name, "Count", ct, "CPU", ct*t.Cost.Cpu, "RAM", uint64(ct)*t.Cost.Ram, "GPU", float64(ct)*t.Cost.Gpu)
}
llog.Infow("Total", "CPU", tmp.Cpu, "RAM", tmp.Ram, "GPU", tmp.Gpu)
return tmp
}

Expand Down

0 comments on commit 0df6eec

Please sign in to comment.