Skip to content

Commit

Permalink
add control cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
huyongqii committed Dec 25, 2024
1 parent 053cbd0 commit ed5e26d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugin/energy/energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (p EnergyPlugin) CreateCgroupHook(ctx *api.PluginContext) {
log.Infof("CreateCgroupHook received for cgroup: %s", req.Cgroup)

boundGPUs := getBoundGPUs(req.Resource, globalMonitor.config.Monitor.GPUType)
globalMonitor.monitor.UpdateTaskCount(true)
globalMonitor.monitor.NodeMonitor.UpdateTaskCount(true)
globalMonitor.monitor.TaskMonitor.Start(req.TaskId, req.Cgroup, boundGPUs)
}

Expand All @@ -143,7 +143,7 @@ func (p EnergyPlugin) DestroyCgroupHook(ctx *api.PluginContext) {
}

log.Infof("DestroyCgroupHook received for cgroup: %s", req.Cgroup)
globalMonitor.monitor.UpdateTaskCount(false)
globalMonitor.monitor.NodeMonitor.UpdateTaskCount(false)
globalMonitor.monitor.TaskMonitor.Stop(req.TaskId)
}

Expand Down
4 changes: 0 additions & 4 deletions plugin/energy/pkg/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,3 @@ func (sm *Monitor) Close() {
sm.NodeMonitor.Close()
sm.TaskMonitor.Close()
}

func (sm *Monitor) UpdateTaskCount(increment bool) {
sm.NodeMonitor.UpdateTaskCount(increment)
}

0 comments on commit ed5e26d

Please sign in to comment.