Fix circular import after merge

This commit is contained in:
Christoph Kluge
2024-07-09 09:50:32 +02:00
parent 0240997257
commit bf6b87d65c
5 changed files with 15 additions and 19 deletions

View File

@@ -284,6 +284,18 @@ func (r *JobRepository) JobsStats(
return stats, nil
}
func LoadJobStat(job *schema.JobMeta, metric string) float64 {
if stats, ok := job.Statistics[metric]; ok {
if metric == "mem_used" {
return stats.Max
} else {
return stats.Avg
}
}
return 0.0
}
func (r *JobRepository) JobCountGrouped(
ctx context.Context,
filter []*model.JobFilter,