Skip to content

Expose Windows Job Object CPU accounting - #65

Closed
kreneskyp wants to merge 3 commits into
watchexec:mainfrom
kreneskyp:ir786-job-object-cpu-snapshot
Closed

kreneskyp wants to merge 3 commits into
watchexec:mainfrom
kreneskyp:ir786-job-object-cpu-snapshot

Conversation

@kreneskyp

@kreneskyp kreneskyp commented Oct 14, 2026 •

Copy link
Copy Markdown

Part of IR-786.

This partial contribution exposes a safe Windows JobObject CPU-time query through the standard-process ChildWrapper API. It reports cumulative user plus kernel time from Job Object accounting, including members that exited before the sample. The Windows integration test exercises a descendant that burns CPU and exits before the parent is sampled.

The resident-memory method fails closed with Unsupported. Windows exposes per-process working-set snapshots, but not a coherent current resident-memory aggregate for a Job Object. This change does not satisfy the resident-memory criterion or complete IR-786.

Checks on macOS:

  • cargo fmt --all -- --check passed.
  • Windows-target cargo check --tests --target x86_64-pc-windows-msvc --no-default-features --features std,job-object passed (compile only; no Windows tests executed).
  • Windows-target Clippy could not complete because rustc could not find the target std; no Clippy pass is claimed.
  • cargo test --locked --features std --all-targets passed (55 tests; Windows-only tests were not executed on macOS).
  • cargo metadata --no-deps --all-features reports no installable binary targets; cargo package --list does not include a helper binary source.

Native Windows execution and upstream CI remain unverified. This branch is based on main; it may need a rebase after the open kill-on-close PR #64, which touches src/std/job_object.rs.

@kreneskyp
kreneskyp marked this pull request as ready for review October 14, 2026 20:04
@passcod

passcod commented Oct 15, 2026

Copy link
Copy Markdown
Member

wtf is "IR-786"

@passcod

passcod commented Oct 15, 2026

Copy link
Copy Markdown
Member

From other PRs by account this appears to be fully-automated AI submissions. Come back with a human touch.

@passcod passcod closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants