elephone-184 opened a new pull request, #4998: URL: https://github.com/apache/rocketmq-dashboard/pull/4998
## What is the purpose of the change When investigating message delivery delays or production incidents in RocketMQ, operators must query message trace records and manually compute time deltas across multiple asynchronous trace spans (`Pub`, `SubBefore`, `SubAfter`). Understanding whether latency was introduced on the producer client, during broker storage and queuing transit, or within the consumer listener is cumbersome. This PR introduces an automated `MessageTraceLifecycleAggregator`: 1. `MessageTraceWaterfallVO` & `TraceStageSpanVO`: Domain models presenting a unified lifecycle timeline, stage durations (send duration, broker transit duration, consumer execution duration), percentage contributions, and bottleneck diagnosis. 2. `MessageTraceLifecycleAggregator`: Reconstructs the complete message lifecycle from raw `TraceRecordVO` / `TraceNodeVO` spans, accurately detects queuing transit lag vs client processing time, and identifies primary bottleneck stages (`PRODUCER_SEND`, `BROKER_STORAGE_TRANSIT`, `CONSUMER_EXECUTION`). 3. Service & Controller wiring: Connects through `MessageService.getMessageTraceWaterfall` and exposes `/api/messages/trace-waterfall` in `MessageController`. 4. Comprehensive unit test suite covering healthy flows, producer bottlenecks, broker transit delay, long consumer execution, and controller/service integration. ## Brief changelog - Add `MessageTraceWaterfallVO.java` domain model. - Add `MessageTraceLifecycleAggregator.java` timeline aggregation logic. - Add `getMessageTraceWaterfall` method in `MessageService`. - Expose `/api/messages/trace-waterfall` endpoint in `MessageController`. - Add `MessageTraceLifecycleAggregatorTest.java` and expand `MessageServiceTest.java` and `MessageControllerTest.java`. ## Verifying this change - `MessageTraceLifecycleAggregatorTest`: verifies end-to-end timeline calculation, stage percentages, and bottleneck classification across send/transit/consume stages. - `MessageServiceTest`: verifies message service delegation to trace aggregator. - `MessageControllerTest`: verifies `/api/messages/trace-waterfall` HTTP GET endpoint response mapping. -- 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]
