mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Children fixes + nomad status outputs summaries
Children object is always initialized instead of lazily. `nomad status` outputs children summaries and has specialized view for constructor jobs.
This commit is contained in:
14
api/jobs.go
14
api/jobs.go
@@ -247,9 +247,17 @@ type JobSummary struct {
|
||||
|
||||
// JobChildrenSummary contains the summary of children job status
|
||||
type JobChildrenSummary struct {
|
||||
Pending uint64
|
||||
Running uint64
|
||||
Dead uint64
|
||||
Pending int64
|
||||
Running int64
|
||||
Dead int64
|
||||
}
|
||||
|
||||
func (jc *JobChildrenSummary) Sum() int {
|
||||
if jc == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return int(jc.Pending + jc.Running + jc.Dead)
|
||||
}
|
||||
|
||||
// TaskGroup summarizes the state of all the allocations of a particular
|
||||
|
||||
Reference in New Issue
Block a user