Skip to content

Commit

Permalink
Sched out displays ID
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmitchell committed May 13, 2020
1 parent 49baf50 commit bb7e119
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/doomsday/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ type GetSchedulerTask struct {
Backend string `json:"backend"`
Reason string `json:"reason"`
Kind string `json:"kind"`
ID uint `json:"id"`
Ready bool `json:"ready"`
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"strconv"
"time"

"github.com/doomsday-project/doomsday/client/doomsday"
Expand Down Expand Up @@ -41,7 +42,7 @@ func printSchedTaskList(tasks []doomsday.GetSchedulerTask) {
table.SetRowLine(true)
table.SetAutoWrapText(false)
table.SetReflowDuringAutoWrap(false)
table.SetHeader([]string{"At", "Backend", "Kind", "Reason", "Ready"})
table.SetHeader([]string{"ID", "At", "Backend", "Kind", "Reason", "Ready"})
table.SetAlignment(tablewriter.ALIGN_RIGHT)

readyStr := ansi.Sprintf("@G{YES}")
Expand All @@ -54,6 +55,7 @@ func printSchedTaskList(tasks []doomsday.GetSchedulerTask) {
readyOutStr = readyStr
}
table.Append([]string{
strconv.FormatUint(uint64(task.ID), 10),
timeUntilStr,
task.Backend,
task.Kind,
Expand Down
2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func getScheduler(manager *SourceManager) func(w http.ResponseWriter, r *http.Re
Backend: schedData.Running[i].Backend,
Reason: schedData.Running[i].Reason,
Kind: schedData.Running[i].Kind,
ID: schedData.Running[i].ID,
Ready: schedData.Running[i].Ready,
})
}
Expand All @@ -207,6 +208,7 @@ func getScheduler(manager *SourceManager) func(w http.ResponseWriter, r *http.Re
Backend: schedData.Pending[i].Backend,
Reason: schedData.Pending[i].Reason,
Kind: schedData.Pending[i].Kind,
ID: schedData.Pending[i].ID,
Ready: schedData.Pending[i].Ready,
})
}
Expand Down

0 comments on commit bb7e119

Please sign in to comment.