Skip to content

feat(client): count sleap-app and sleap-nn processes in session metrics - #510

Open
gitttt-1234 wants to merge 1 commit into
fix/tofu-backend-bucket-regionfrom
feat/monitoring-sleap-app
Open

gitttt-1234 wants to merge 1 commit into
fix/tofu-backend-bucket-regionfrom
feat/monitoring-sleap-app

Conversation

@gitttt-1234

@gitttt-1234 gitttt-1234 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #509 (fix/tofu-backend-bucket-region) so the CLI fix and this change can be installed from one branch. Merge #509 first; GitHub will then retarget this PR to main.

Summary

Session metrics' time-to-first-label/train/track milestones only recognise SLEAP 1.x processes (sleap-label, sleap track …, python -m sleap.cli train …). On a sleap-app deployment they never fire. This maps sleap-app's processes onto the same canonical names:

Process (as seen in /proc/<pid>/cmdline) Counted as
/usr/bin/sleap-app (GUI binary, from the .deb) sleap-label
<uv python> ~/.local/bin/sleap-nn train … sleap-train
sleap-nn predict … (or track on sleap-nn < 0.2) sleap-track

The DB columns, cohort summary, export and process_allowlist default don't change. Removing a canonical name from the allowlist still turns off its sleap-app equivalent.

How sleap-app launches these

From talmolab/sleap-app main at 3010697:

  • The GUI binary is the Cargo package name, sleap-app.
  • Training: runTraining → run_python_command("sleap-nn", ["train", …]) (src/platform/backend.ts).
  • Inference: sleap-nn predict on sleap-nn ≥ 0.2, otherwise sleap-nn track (pickInferenceSubcommand).
  • sleap-nn export and the overlay/progress sidecars (<python> -u <script>) aren't milestones and don't match.

The other session metrics need no changes for sleap-app:

  • The window title <file> - SLEAP v<version> matches the default sleap pattern.
  • .slp files are HDF5 with a frames table.
  • Models go in <project>/models/<run>/, so **/models/**/training_log.csv finds them.

Testing

  • Added tests in packages/client/tests/monitoring/samplers/test_processes.py for the GUI binary, sleap-nn train launched via uv, predict/track, unknown subcommands, and allowlist handling.
  • PYTHONPATH=src uv run pytest in packages/client: 186 passed. ruff check packages/client: clean.
  • Not yet checked on a live sleap-app VM.

🤖 Generated with Claude Code

@gitttt-1234
gitttt-1234 changed the base branch from main to fix/tofu-backend-bucket-region October 10, 2026 00:11
The process sampler only recognised SLEAP 1.x launch shapes, so the
time-to-first label/train/track milestones never fired on sleap-app
deployments. Map sleap-app's GUI binary to sleap-label, and sleap-nn
train / predict / track to sleap-train / sleap-track. The canonical
names, DB columns and summary are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitttt-1234
gitttt-1234 force-pushed the feat/monitoring-sleap-app branch from a275396 to 4eca856 Compare October 10, 2026 00:12
@gitttt-1234
gitttt-1234 marked this pull request as ready for review October 10, 2026 00:44

This branch has not been deployed

No deployments
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.

1 participant