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

[ISSUE #6033] modify TraceContext toString method #6034

Merged
merged 4 commits into from
Feb 12, 2023
Merged

[ISSUE #6033] modify TraceContext toString method #6034

merged 4 commits into from
Feb 12, 2023

Conversation

hardyfish
Copy link
Contributor

Make sure set the target branch to develop

What is the purpose of the change

close #6033

Brief changelog

modify TraceContext toString method

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@hardyfish hardyfish closed this Feb 11, 2023
@hardyfish hardyfish reopened this Feb 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Merging #6034 (1d6d168) into develop (4cfd54f) will increase coverage by 0.06%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #6034      +/-   ##
=============================================
+ Coverage      43.33%   43.40%   +0.06%     
- Complexity      8843     8852       +9     
=============================================
  Files           1093     1093              
  Lines          76851    76851              
  Branches       10015    10015              
=============================================
+ Hits           33307    33354      +47     
+ Misses         39380    39342      -38     
+ Partials        4164     4155       -9     
Impacted Files Coverage Δ
...org/apache/rocketmq/client/trace/TraceContext.java 75.00% <0.00%> (ø)
.../org/apache/rocketmq/store/ha/DefaultHAClient.java 59.48% <0.00%> (-2.57%) ⬇️
.../apache/rocketmq/controller/ControllerManager.java 71.87% <0.00%> (-2.09%) ⬇️
...saction/queue/TransactionalMessageServiceImpl.java 50.89% <0.00%> (-1.03%) ⬇️
...rocketmq/broker/processor/PopMessageProcessor.java 36.68% <0.00%> (-0.46%) ⬇️
...main/java/org/apache/rocketmq/store/CommitLog.java 64.93% <0.00%> (-0.21%) ⬇️
...e/rocketmq/namesrv/routeinfo/RouteInfoManager.java 63.75% <0.00%> (+0.32%) ⬆️
.../org/apache/rocketmq/proxy/config/ProxyConfig.java 45.00% <0.00%> (+0.35%) ⬆️
...a/org/apache/rocketmq/store/StoreStatsService.java 34.53% <0.00%> (+0.55%) ⬆️
...cketmq/store/ha/autoswitch/AutoSwitchHAClient.java 76.89% <0.00%> (+0.72%) ⬆️
... and 12 more

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

@hardyfish hardyfish changed the title [#6033] modify TraceContext toString method [ISSUE #6033] modify TraceContext toString method Feb 11, 2023
@hardyfish
Copy link
Contributor Author

why did this fail?

return "TraceContext{" + sb.toString() + '}';
return "TraceContext{" + sb + '}';
Copy link
Member

Choose a reason for hiding this comment

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

How about like this:

        StringBuilder sb = new StringBuilder(1024);
        sb.append("TraceContext{").append(traceType).append("_").append(groupName)
            .append("_").append(regionId).append("_").append(isSuccess).append("_");
        if (traceBeans != null && traceBeans.size() > 0) {
            for (TraceBean bean : traceBeans) {
                sb.append(bean.getMsgId()).append("_").append(bean.getTopic()).append("_");
            }
        }
        sb.append('}');
        return sb.toString();

Copy link
Member

@mxsm mxsm left a comment

Choose a reason for hiding this comment

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

LGTM~

@hardyfish
Copy link
Contributor Author

please help me merge, thank you.

@RongtongJin RongtongJin merged commit bc1c5e1 into apache:develop Feb 12, 2023
drpmma pushed a commit that referenced this pull request Feb 21, 2023
* modify TraceContext toString method

* modify TraceContext toString method

* code optimization

* format code
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.

modify TraceContext toString method
5 participants