mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
update
This commit is contained in:
parent
9609c500dc
commit
e094fda5c4
@ -93,7 +93,7 @@ type MsgJobReq struct {
|
||||
}
|
||||
|
||||
type MsgJobReqPredict struct {
|
||||
Code int `json:"code"`
|
||||
Error string `json:"error"`
|
||||
Labels map[string]float64 `json:"labels"`
|
||||
Code int `json:"code"`
|
||||
Error string `json:"error"`
|
||||
Labels string `json:"labels"`
|
||||
}
|
||||
|
@ -470,7 +470,8 @@ func (optimizer *Optimizer) PredictReq(job Job, role string) MsgJobReq {
|
||||
var msg MsgJobReqPredict
|
||||
err = json.Unmarshal([]byte(string(body)), &msg)
|
||||
if err == nil && msg.Code == 0 {
|
||||
tmp := msg.Labels
|
||||
var tmp map[string]float64
|
||||
err = json.Unmarshal([]byte(msg.Labels), &tmp)
|
||||
if v, ok := tmp["cpu"]; ok {
|
||||
req.CPU = int(math.Ceil(v / 100))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user