Observation sessions¶
Observation sessions restrict and associate process resource collection with a specific command or execution window. Use daemonitor-cli observe when you want a process resource summary scoped to a particular invocation.
Running an observed build¶
Pass the build command after --:
Xcode example:
What happens during observe:
daemonitor-clispawns the command with inheritedstdin,stdout, andstderrso build output streams normally.- It opens an explicit session via
POST /v1/sessionswith the redacted command line, anchor PID/start time, inferred ecosystem (xcodeforxcodebuild/swift/swiftc,gradleforgradlew/gradle, otherwisegeneric), and project path (extracted fromxcodebuildflags or current working directory). daemonitor-coredimmediately wakes its poll loop and accelerates polling to 1 second while the session is active.- When the child command exits,
daemonitor-clicloses the session viaPOST /v1/sessions/{id}/close, prints the session summary tostderr, and exits with the child command's exact exit code (127if the command could not start,130on interrupt).
Saving a JSON summary¶
Write a copy of the JSON session summary to disk (mode 0600) while keeping build stdout clean:
Override ecosystem or project detection explicitly if needed:
Listing and inspecting past sessions¶
List persisted observation sessions (default --limit 50):
Inspect a single session with per-role rollups and attributed processes:
Attribution and peak aggregation¶
In session summaries:
- Processes are attributed as
confirmed(anchor process, descendant within depth 8, or matching-derivedDataPath/ project path),inferred, orambiguous(when concurrent overlapping Xcode builds share no distinct-derivedDataPath). total_peak_rss_mb,total_peak_footprint_bytes, andmax_parallelismare computed per sample timestamp (taking the maximum simultaneous sum across ticks) rather than summing individual process peaks across non-overlapping jobs.- Cumulative CPU seconds and disk I/O bytes are computed as per-incarnation deltas (
last - firstfor pre-existing daemons,lastfor processes started after session open).
See Build history & observation sessions for how explicit and passive sessions work under the hood.