davsclaus opened a new pull request, #27926:
URL: https://github.com/apache/camel/pull/27926

   Step 6 of [CAMEL-25388](https://issues.apache.org/jira/browse/CAMEL-25388): 
`camel get`, `camel top` and `camel ps` find the integrations with one helper 
and print JSON that a script can use without parsing text.
   
   ### Listing
   - One `ProcessBaseCommand.forEachIntegration(name, consumer)` (on 
`ProcessFinder`, CAMEL-25391) instead of the copied loops: a name or pid that 
matches no running integration exits `3`; with nothing running the listings 
print `No running Camel integrations` on stderr and exit `0` (`[]` with 
`--json`).
   - A status file a listing cannot read (an older Camel without a value the 
listing needs) skips that integration with a `WARN:` on stderr, instead of 
failing the listing of every integration.
   - `camel get health` takes a name or pid like the other listings.
   
   ### JSON of the listings
   - Numbers are numbers: `pid`, the counters, the processing times and 
`throughput` (`JsonValues`); a missing value is `null`, not `""` or `-`.
   - Values that combined several numbers are split: `sinceLast` into 
`sinceLastStarted`/`sinceLastCompleted`/`sinceLastFailed`; `route` of `get 
context` into `routesStarted`/`routesTotal` and `reload` into 
`reloaded`/`reloadFailed`; `load`, `heap`, `nonHeap`, `gc` and `threads` of 
`top context`; `rl`, `rate` and `since` of `get health`.
   - `uptime` in millis next to `age`; durations in millis (`blocked`, 
`inflight`, `internal-task`, `groovy`); `routeId` and `status` as the names 
everywhere; `ready` is a boolean; `camel ps` has `failed` instead of `fail`.
   
   ### Fixes
   - `camel get activity` showed decades since the last exchange (subtracted 
twice).
   - `camel dirty` kept `123-status.json` for pid `12` (prefix match), and 
removed the files of a process that is alive.
   - `camel get endpoint/consumer/producer --limit` limited before sorting; 
`camel get processor --limit` counted processors instead of routes.
   
   ### Docs
   - 4.24 upgrade guide: "camel get, top and ps: not found, unreadable status, 
and the JSON of the listings".
   
   ### Tests
   - `ListingContractTest`: an unreadable status file is skipped with a 
warning, a name that matches nothing exits 3, numbers in the JSON of `get 
context` and `ps`, `Dirty.pidOf`.
   - `DirtyTest` rewritten for the pid matching; `ListEndpointTest` sorts 
before limiting; `ListActivityTest`; the listing tests updated for the JSON 
names.
   - `mvn test` of camel-jbang-core: all tests pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to