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

   ## Summary
   
   - Add p50, p95, p99 percentile processing time statistics to Camel's 
management layer, enabled only when `ManagementStatisticsLevel=Extended` (zero 
overhead otherwise)
   - Uses a sliding-window ring buffer (`long[1024]`) per 
route/processor/context to compute exact percentiles over recent exchanges 
(~8KB memory per counter)
   - Exposes percentile values via JMX MBean attributes, `dumpStatsAsXml/Json`, 
and all dev consoles (route, context, top, processor, consumer, route-group)
   
   ## Implementation Details
   
   **Core changes (camel-management-api + camel-management):**
   - `ManagedPerformanceCounterMBean`: new `getProcessingTimeP50()`, 
`getProcessingTimeP95()`, `getProcessingTimeP99()` methods
   - `ManagedPerformanceCounter`: ring buffer allocation in 
`initExtendedStatistics()`, recording in `completedExchange()`, on-demand 
percentile computation via sorted snapshot
   - `ManagedRoute`, `ManagedProcessor`, `ManagedCamelContext`, 
`ManagedRouteGroup`: call `initExtendedStatistics()` when statistics level is 
Extended
   
   **Dev console changes (camel-console):**
   - `RouteDevConsole`: text + JSON output includes p50/p95/p99 when available
   - `ContextDevConsole`, `TopDevConsole`, `ProcessorDevConsole`, 
`ConsumerDevConsole`, `RouteGroupDevConsole`: JSON output includes p50/p95/p99
   
   **Design decisions:**
   - Returns -1 when Extended statistics is not enabled
   - Sliding window of 1024 gives exact percentiles (no approximation) over 
recent activity
   - No external dependency needed (no HDRHistogram)
   
   Jira: https://issues.apache.org/jira/browse/CAMEL-23976
   
   ## Test plan
   
   - [x] `ManagedPercentileStatisticsTest` — verifies p50/p95/p99 on route and 
context MBeans with Extended level
   - [x] `ManagedPercentileStatisticsDefaultLevelTest` — verifies methods 
return -1 with Default level (no overhead)
   
   _Claude Code on behalf of davsclaus_
   
   Co-Authored-By: Claude Opus 4.6 <[email protected]>


-- 
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