func (c *Cluster) topJobsFailed(count int) []*Job {
	slice := make([]*Job, len(c.jobs))
	i := 0
	for jobName, builds := range c.jobs {
		slice[i] = &Job{Name: jobName, Builds: builds}
		i++
	}
	less := func(i, j int) bool { return len(slice[i].Builds) > len(slice[j].Builds) }
	sort.SliceStable(slice, less)

	if len(slice) < count {
		count = len(slice)
	}
	return slice[0:count]
}
func (c *Cluster) topJobsFailed(count int) []*Job {
	slice := make([]*Job, len(c.jobs))
	i := 0
	for jobName, builds := range c.jobs {
		slice[i] = &Job{Name: jobName, Builds: builds}
		i++
	}
	less := func(i, j int) bool { return len(slice[i].Builds) > len(slice[j].Builds) }
	sort.SliceStable(slice, less)

	if len(slice) < count {
		count = len(slice)
	}
	return slice[0:count]
}
func ( c * Cluster ) topJobsFailed ( count int ) [ ] * Job { slice := make ( [ ] * Job , len ( c . jobs ) ) i := 0 for jobName , builds := range c . jobs { slice [ i ] = & Job { Name : jobName , Builds : builds } i ++ } less := func ( i , j int ) bool { return len ( slice [ i ] . Builds ) > len ( slice [ j ] . Builds ) } sort . SliceStable ( slice , less ) if len ( slice ) < count { count = len ( slice ) } return slice [ 0 : count ] }
// topJobsFailed returns the top 'count' job names sorted by number of failing builds.
topJobsFailed returns the top count job names sorted by number of failing builds .