diff --git a/internal/repository/job.go b/internal/repository/job.go index 449c267..b14fd53 100644 --- a/internal/repository/job.go +++ b/internal/repository/job.go @@ -478,6 +478,12 @@ func (r *JobRepository) CountGroupedJobs( now := time.Now().Unix() count = fmt.Sprintf(`sum(job.num_nodes * (CASE WHEN job.job_state = "running" THEN %d - job.start_time ELSE job.duration END)) as count`, now) runner = r.DB + case model.WeightsCoreCount: + count = "sum(job.num_hwthreads) as count" + case model.WeightsCoreHours: + now := time.Now().Unix() + count = fmt.Sprintf(`sum(job.num_hwthreads * (CASE WHEN job.job_state = "running" THEN %d - job.start_time ELSE job.duration END)) as count`, now) + runner = r.DB default: log.Debugf("CountGroupedJobs() Weight %v unknown.", *weight) } diff --git a/web/frontend/src/Analysis.root.svelte b/web/frontend/src/Analysis.root.svelte index 4022826..c6e4575 100644 --- a/web/frontend/src/Analysis.root.svelte +++ b/web/frontend/src/Analysis.root.svelte @@ -67,7 +67,7 @@ histNumNodes { count, value } } - topUsers: jobsCount(filter: $jobFilters, groupBy: USER, weight: NODE_HOURS, limit: 5) { name, count } + topUsers: jobsCount(filter: $jobFilters, groupBy: USER, weight: CORE_HOURS, limit: 5) { name, count } } `, variables: { jobFilters } @@ -172,7 +172,7 @@ - + {#each $statsQuery.data.topUsers.sort((a, b) => b.count - a.count) as { name, count }, i}
LegendUser NameNode Hours
LegendUser NameCore Hours