fix(bug-1736): capture memory_swap/tasks_current, compute peak_cpu_time
The worker's rusage collector already measures and sends "memory_swap"/"tasks_current" per job, but xce_host_runusage_t had no field to receive them at all -- a complete dead end, not a naming mismatch like bug-1735's cpu_time/mem_usage. Added mem_swap/ tasks_current fields (types.h), matching capnp fields on HostRunusage (controller.capnp, new ordinals @3/@4) for WAL field-completeness, and wired update_host_runusage() (misc.c) to parse them. Also fixed merge_job_runusage()'s (job.c) existing-host merge branch, which only copied cpu_time/mem_usage per host -- the two new fields would otherwise have been silently dropped on WAL replay/catchup for a host already seen. Also computed peak_cpu_time as the running max of aggregate_job_ runusage()'s per-call cpu_time sum across every report a job has ever received, guarding against a later report reducing it. Deliberately NOT computed: peak_cpu_duration and the three efficiency fields (mem_efficiency/avg_cpu_efficiency/peak_cpu_efficiency) -- these need a "used vs. requested" ratio against a job's resource request (a resreq expression tree, not a plain core/slot count) and/or an unspecified duration semantic. A documented scope decision, not an oversight -- see aggregate_job_runusage()'s doc comment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QxaSzHRB7pmYFp4cVnwkA
This commit is contained in:
parent
dfcd345ded
commit
5c2c6664e5
5 changed files with 169 additions and 26 deletions
|
|
@ -416,6 +416,8 @@ typedef struct {
|
|||
char* host_name;
|
||||
int cpu_time;
|
||||
double mem_usage;
|
||||
double mem_swap;
|
||||
int tasks_current;
|
||||
} xce_host_runusage_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue