fix(controller,apiserver,xcecli): expose job CPU peak and efficiency to the apiserver and xcecli (bug-1736)
The controller computed run usage (CPU time, memory, CPU peak and efficiency, LSF bjobs -l definitions) but the capnp Job struct had no field for it, so the job pushed to the apiserver never carried it, and snapshots (the same struct) dropped it: a job restored from a checkpoint lost its accumulated usage. - controller.capnp: Job.runUsage @13 (JobRunusage); old entries decode with no run usage. - apiserver: map run_usage into JobInfo; max_mem, avg_mem, used_mem, cpu_time, peak_cpu, peak_cpu_time, peak_cpu_duration, mem_efficiency, avg_cpu_efficiency, peak_cpu_efficiency become queryable columns. - xcecli: -o fields MAX_MEM, AVG_MEM, MEM_EFFICIENCY, CPU_PEAK, CPU_PEAK_DURATION, CPU_EFFICIENCY, CPU_PEAK_EFFICIENCY (CPU_TIME now renders too), and a MEMORY USAGE / CPU USAGE block in jobs list -l. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e2472aa73c
commit
1cedd7f791
9 changed files with 466 additions and 56 deletions
|
|
@ -114,6 +114,20 @@ func cJobToModel(job *C.xce_job_t) *models.JobInfo {
|
|||
}
|
||||
r.submit = rd
|
||||
}
|
||||
if u := job.run_usage; u != nil {
|
||||
r.runUsage = &rawRunUsage{
|
||||
maxMem: float64(u.max_mem),
|
||||
avgMem: float64(u.avg_mem),
|
||||
usedMem: float64(u.used_mem),
|
||||
cpuTime: int(u.cpu_time),
|
||||
peakCPUTime: int(u.peak_cpu_time),
|
||||
peakCPUDuration: int(u.peak_cpu_duration),
|
||||
memEfficiency: float64(u.mem_efficiency),
|
||||
avgCPUEfficiency: float64(u.avg_cpu_efficiency),
|
||||
peakCPUEfficiency: float64(u.peak_cpu_efficiency),
|
||||
peakCPU: float64(u.peak_cpu),
|
||||
}
|
||||
}
|
||||
if job.allocs != nil {
|
||||
n := int(job.allocs.nhosts)
|
||||
for i := 0; i < n; i++ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue