Closed mxsm closed 1 month ago
The recent changes enhance the RocketMQ broker by integrating a statistics management system into the message processing workflow. Key improvements include the addition of a broker_stats_manager
to track message statistics and refine performance metrics. New utility functions for generating unique client IDs and retrieving local IP addresses were introduced, along with error handling enhancements. These updates collectively aim to improve monitoring capabilities and the efficiency of message operations.
File Path | Change Summary |
---|---|
rocketmq-broker/src/broker_runtime.rs |
Added broker_stats_manager to BrokerRuntime for enhanced statistics tracking. |
rocketmq-broker/src/processor/send_message_processor.rs |
Integrated broker_stats_manager in SendMessageProcessor and refactored message handling methods. |
rocketmq-common/Cargo.toml |
Added hex crate dependency for hexadecimal encoding/decoding. |
rocketmq-common/src/common/message/message_client_id_setter.rs |
Enhanced MessageClientIDSetter for generating unique, time-sensitive IDs with atomic state management. |
rocketmq-common/src/error.rs |
Introduced RuntimeException variant to the Error enum for flexible error handling. |
rocketmq-common/src/lib.rs |
Added type alias Result<T> for standardized error handling across the module. |
rocketmq-common/src/utils/time_utils.rs |
Added #[inline] attribute to get_current_millis and get_current_nano functions for potential performance improvement. |
rocketmq-common/src/utils/util_all.rs |
Introduced get_ip function for retrieving local IP addresses; optimized write_int and write_short functions. |
rocketmq-remoting/src/protocol/remoting_command.rs |
Added methods for mutable access and modifying command types in RemotingCommand . |
rocketmq-remoting/src/protocol/static_topic/logic_queue_mapping_item.rs |
Added compute_static_queue_offset_loosely method for flexible offset calculations. |
rocketmq-store/src/stats/broker_stats_manager.rs |
Added methods for incrementing broker and queue statistics, enhancing monitoring capabilities. |
sequenceDiagram
participant Client
participant SendMessageProcessor
participant BrokerStatsManager
Client->>SendMessageProcessor: Send Message
SendMessageProcessor->>BrokerStatsManager: inc_broker_put_nums()
SendMessageProcessor->>BrokerStatsManager: inc_queue_put_nums()
SendMessageProcessor->>BrokerStatsManager: inc_queue_put_size()
SendMessageProcessor->>Client: Acknowledge Receipt
🐰 In the meadow, where the bunnies play,
New features hop in, brightening the day.
Stats to track, messages soar,
With every change, we’ll explore more!
🥕 Let’s celebrate with a joyful cheer,
As RocketMQ grows, our path is clear!
🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
Attention: Patch coverage is 25.25952%
with 216 lines
in your changes missing coverage. Please review.
Project coverage is 28.13%. Comparing base (
ed2c4f2
) to head (46ac48a
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which Issue(s) This PR Fixes(Closes)
Fixes #816
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
RemotingCommand
structure with more flexible configuration options through new public methods.Bug Fixes
Documentation
Refactor