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:
Alex Dadgar
2016-12-14 16:58:54 -08:00
parent 2ba26fc413
commit bf9355ac4f
5 changed files with 146 additions and 39 deletions

View File

@@ -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