just command for reading journald db #1

Closed
opened 2026-10-14 04:13:50 +02:00 by Levitating · 4 comments
Owner

We already use structured journald logs as a form of database, ow I want a just stats or similar just script which gives an overview of the jobs found in the logs.

Include the trigger type, outcome, money spent. etc

Rfer to readme

We already use structured journald logs as a form of database, ow I want a `just stats` or similar just script which gives an overview of the jobs found in the logs. Include the trigger type, outcome, money spent. etc Rfer to readme
Author
Owner

@Claude retry

@Claude retry
Collaborator

I added just stats and opened #2 for it.

just stats prints a line per job: start time, thread, trigger (label or mention), requester, outcome, turns and cost. Below that are totals by trigger, outcome, repository and requester. It passes extra arguments to journalctl, so just stats --since=-7d or just stats REPO=someone/widget work.

The journal didn't record trigger or outcome as fields, so I made two changes in job.rb:

  • A job now logs TRIGGER and ACTOR when it starts.
  • It logs one finished entry with OUTCOME when it ends: pull_request, replied, silent, rejected or error.

Jobs from before this change show ? for trigger, requester and outcome. The README describes the recipe under Logs.

I tried libexec/stats only on hand-made journal JSON, not on a real journal. I couldn't run bundle exec rake, because the gems aren't installed here, so the job.rb change hasn't been run through the tests.

I added `just stats` and opened #2 for it. `just stats` prints a line per job: start time, thread, trigger (`label` or `mention`), requester, outcome, turns and cost. Below that are totals by trigger, outcome, repository and requester. It passes extra arguments to `journalctl`, so `just stats --since=-7d` or `just stats REPO=someone/widget` work. The journal didn't record trigger or outcome as fields, so I made two changes in `job.rb`: - A job now logs `TRIGGER` and `ACTOR` when it starts. - It logs one `finished` entry with `OUTCOME` when it ends: `pull_request`, `replied`, `silent`, `rejected` or `error`. Jobs from before this change show `?` for trigger, requester and outcome. The README describes the recipe under Logs. I tried `libexec/stats` only on hand-made journal JSON, not on a real journal. I couldn't run `bundle exec rake`, because the gems aren't installed here, so the `job.rb` change hasn't been run through the tests.
Author
Owner

@Claude now I also want a just jobs which lists the currently running jobs with systemctl status

@Claude now I also want a `just jobs` which lists the currently running jobs with systemctl status
Collaborator

I added just jobs and opened it as #3. It lists the running claude-forge-agent@*.service units and runs systemctl status on them. With no jobs running it prints "No jobs running" instead of letting systemctl fail on a glob that matches nothing.

I haven't seen it run against a live job. The sandbox can't reach the system bus, so I only confirmed that just --list shows the recipe and that just jobs prints "No jobs running".

just status already shows the bot service together with all loaded agent units. jobs shows only the agent units that are running.

I added `just jobs` and opened it as #3. It lists the running `claude-forge-agent@*.service` units and runs `systemctl status` on them. With no jobs running it prints "No jobs running" instead of letting systemctl fail on a glob that matches nothing. I haven't seen it run against a live job. The sandbox can't reach the system bus, so I only confirmed that `just --list` shows the recipe and that `just jobs` prints "No jobs running". `just status` already shows the bot service together with all loaded agent units. `jobs` shows only the agent units that are running.
Sign in to join this conversation.
No labels
claude
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Levitating/claude-forge#1
No description provided.