feat(build): record the processor time a build consumed (#67) #67

Merged
mi merged 1 commits from build-cpu-time into main 2026-09-15 13:00:22 +02:00
Owner

A duration cannot say whether a build worked or waited. The half hour in
which the instance could not start a single child process (PR#64) looked
like a slow half hour; a processor figure of nearly zero beside a normal
duration would have said what it was.

A sampler follows the build's process tree through the kernel's own
/proc//task//children once a second and keeps the largest sum
of utime+stime+cutime+cstime over the live processes, summed over the
build's commands. ProcessHandle.descendants() would have walked the whole
of /proc -- measured at 12 ms for 426 processes, and a shared hive has
thousands, for a tree of a few dozen.

Null where nothing was measured, never zero: a recorded zero reads as a
build that ran without using the processor. Shown on the build page beside
the duration with its factor against the wall clock, served as cpuSeconds.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

A duration cannot say whether a build worked or waited. The half hour in which the instance could not start a single child process (PR#64) looked like a slow half hour; a processor figure of nearly zero beside a normal duration would have said what it was. A sampler follows the build's process tree through the kernel's own /proc/<pid>/task/<tid>/children once a second and keeps the largest sum of utime+stime+cutime+cstime over the live processes, summed over the build's commands. ProcessHandle.descendants() would have walked the whole of /proc -- measured at 12 ms for 426 processes, and a shared hive has thousands, for a tree of a few dozen. Null where nothing was measured, never zero: a recorded zero reads as a build that ran without using the processor. Shown on the build page beside the duration with its factor against the wall clock, served as cpuSeconds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi added 1 commit 2026-09-15 12:55:50 +02:00
A duration cannot say whether a build worked or waited. The half hour in
which the instance could not start a single child process (PR#64) looked
like a slow half hour; a processor figure of nearly zero beside a normal
duration would have said what it was.

A sampler follows the build's process tree through the kernel's own
/proc/<pid>/task/<tid>/children once a second and keeps the largest sum
of utime+stime+cutime+cstime over the live processes, summed over the
build's commands. ProcessHandle.descendants() would have walked the whole
of /proc -- measured at 12 ms for 426 processes, and a shared hive has
thousands, for a tree of a few dozen.

Null where nothing was measured, never zero: a recorded zero reads as a
build that ran without using the processor. Shown on the build page beside
the duration with its factor against the wall clock, served as cpuSeconds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi merged commit 008cd3c987 into main 2026-09-15 13:00:22 +02:00
mi deleted branch build-cpu-time 2026-09-15 13:00:22 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkator#67