Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RIP-46] Enhanced metrics for timing and transactional messages #7500

Merged
merged 20 commits into from
Jan 22, 2024

Conversation

GenerousMan
Copy link
Contributor

@GenerousMan GenerousMan commented Oct 25, 2023

Which Issue(s) This PR Fixes

Some enhanced metrics of RIP-46, link to #5350

Brief Description

The following metrics related to timing messages have been added:

  1. rocketmq_timing_end_messages_total, COUNTER, records the number of timing messages that have ended, aggregated by topic.
  2. rocketmq_delay_message_latency, HISTOGRAM, records the distribution of timing message delay durations when sent, aggregated by topic.
  3. rocketmq_timer_message_snapshot, GUAGE, records the distribution of timing messages in the timing wheel (right now). Not aggregated by topic.

The following metrics related to transactional messages have been added:

  1. rocketmq_half_messages, GAUGE, records the number of half messages in transactional scenarios, aggregated by topic.
  2. rocketmq_commit_messages_total, COUNTER, records the number of messages committed in transactions, aggregated by topic.
  3. rocketmq_rollback_messages_total, COUNTER, records the number of messages rolled back in transactions, aggregated by topic.
  4. rocketmq_transaction_finish_latency, HISTOGRAM, records the distribution of delay times for committing transactional half messages, aggregated by topic.

In addition, to calculate metrics related to transactional messages, a new data structure called TransactionMetrics has been added to record the number of transactional half messages under each topic.

How Did You Test This Change?

I will provide a test report later.

@codecov-commenter
Copy link

Codecov Report

Merging #7500 (ca74b6b) into develop (d7e5c4d) will increase coverage by 0.47%.
Report is 32 commits behind head on develop.
The diff coverage is 35.80%.

@@              Coverage Diff              @@
##             develop    #7500      +/-   ##
=============================================
+ Coverage      42.53%   43.01%   +0.47%     
- Complexity      9441     9698     +257     
=============================================
  Files           1150     1160      +10     
  Lines          82746    84219    +1473     
  Branches       10778    10936     +158     
=============================================
+ Hits           35196    36226    +1030     
- Misses         43139    43499     +360     
- Partials        4411     4494      +83     
Files Coverage Δ
...apache/rocketmq/broker/BrokerPathConfigHelper.java 81.25% <100.00%> (+1.25%) ⬆️
...rocketmq/broker/metrics/BrokerMetricsConstant.java 0.00% <ø> (ø)
...etmq/broker/processor/EndTransactionProcessor.java 56.54% <100.00%> (+2.91%) ⬆️
...etmq/remoting/metrics/RemotingMetricsConstant.java 0.00% <ø> (ø)
...tmq/store/metrics/DefaultStoreMetricsConstant.java 0.00% <ø> (ø)
...apache/rocketmq/store/timer/TimerMessageStore.java 53.97% <100.00%> (+0.40%) ⬆️
...ueue/DefaultTransactionalMessageCheckListener.java 81.81% <0.00%> (-2.56%) ⬇️
...saction/queue/TransactionalMessageServiceImpl.java 51.75% <85.71%> (+0.35%) ⬆️
...er/transaction/TransactionMetricsFlushService.java 88.23% <88.23%> (ø)
.../java/org/apache/rocketmq/common/BrokerConfig.java 27.19% <25.00%> (-0.02%) ⬇️
... and 5 more

... and 118 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -18,7 +18,6 @@

public class RemotingMetricsConstant {
public static final String HISTOGRAM_RPC_LATENCY = "rocketmq_rpc_latency";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to change this line

@@ -65,10 +43,35 @@
import org.apache.rocketmq.store.config.BrokerRole;
import org.apache.rocketmq.store.config.MessageStoreConfig;
import org.apache.rocketmq.store.logfile.MappedFile;
import org.apache.rocketmq.store.metrics.DefaultStoreMetricsConstant;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many import changes, and most are not needed

@RongtongJin
Copy link
Contributor

LGTM~

@RongtongJin RongtongJin merged commit 6d75134 into apache:develop Jan 22, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants