diff --git a/command/alloc_status.go b/command/alloc_status.go index c80eadb3a..b8645df23 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -3,8 +3,6 @@ package command import ( "fmt" "strings" - - "github.com/hashicorp/nomad/nomad/structs" ) type AllocStatusCommand struct { @@ -72,15 +70,13 @@ func (c *AllocStatusCommand) Run(args []string) int { fmt.Sprintf("NodesFiltered|%d", alloc.Metrics.NodesFiltered), fmt.Sprintf("NodesExhausted|%d", alloc.Metrics.NodesExhausted), fmt.Sprintf("AllocationTime|%s", alloc.Metrics.AllocationTime), - fmt.Sprintf("CoalescedFailures|%s", alloc.Metrics.CoalescedFailures), + fmt.Sprintf("CoalescedFailures|%d", alloc.Metrics.CoalescedFailures), } c.Ui.Output(formatKV(basic)) - // Format any scheduling failures - if alloc.DesiredStatus == structs.AllocDesiredStatusFailed { - c.Ui.Output("\n==> Scheduling Errors") - dumpAllocStatus(c.Ui, alloc) - } + // Format the detailed status + c.Ui.Output("\n==> Status") + dumpAllocStatus(c.Ui, alloc) return 0 } diff --git a/command/monitor.go b/command/monitor.go index d4da6475a..be9b816dc 100644 --- a/command/monitor.go +++ b/command/monitor.go @@ -298,4 +298,9 @@ func dumpAllocStatus(ui cli.Ui, alloc *api.Allocation) { for dim, num := range alloc.Metrics.DimensionExhausted { ui.Output(fmt.Sprintf(" * Dimension %q exhausted on %d nodes", dim, num)) } + + // Print scores + for name, score := range alloc.Metrics.Scores { + ui.Output(fmt.Sprintf(" * Score %q = %f", name, score)) + } }