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

Metrics RT count optimization #11628

Merged
merged 3 commits into from
Feb 25, 2023
Merged

Metrics RT count optimization #11628

merged 3 commits into from
Feb 25, 2023

Conversation

mytang0
Copy link
Member

@mytang0 mytang0 commented Feb 21, 2023

What is the purpose of the change

Optimize the logic of addRT and collectRT:

  1. Improve computing performance

old

    private final ConcurrentMap<M, AtomicLong>      lastRT = new ConcurrentHashMap<>();
    private final ConcurrentMap<M, LongAccumulator> minRT  = new ConcurrentHashMap<>();
    private final ConcurrentMap<M, AtomicLong>      totalRT = new ConcurrentHashMap<>();
    private final ConcurrentMap<M, AtomicLong>      rtCount = new ConcurrentHashMap<>();

new

    // lastRT, totalRT, rtCount, avgRT share a container, can utilize the system cache line
    private final ConcurrentMap<M, AtomicLongArray> RTArray = new ConcurrentHashMap<>();
  1. Optimize the interface design of MetricsCountSampler

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field 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.
  • 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.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test 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 sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@mytang0
Copy link
Member Author

mytang0 commented Feb 22, 2023

Please take a look @songxiaosheng

@songxiaosheng
Copy link
Member

Please take a look @songxiaosheng

ok please wait

* origin/3.2:
  Observability task: metadata center (apache#11593)
  Enhance the way to get dubbo version (apache#11574)
  Bump protobuf-java from 3.21.12 to 3.22.0 (apache#11615)
  Bump maven-surefire-plugin from 3.0.0-M8 to 3.0.0-M9 (apache#11613)
  Bump micrometer-bom from 1.10.3 to 1.10.4 (apache#11611)
  Bump libthrift from 0.17.0 to 0.18.0 (apache#11614)
  Bump maven-failsafe-plugin from 3.0.0-M8 to 3.0.0-M9 (apache#11612)
  Bump reactor-core from 3.5.2 to 3.5.3 (apache#11610)
  Bump byte-buddy from 1.13.0 to 1.14.0 (apache#11609)
  Bump maven-javadoc-plugin from 3.4.1 to 3.5.0 (apache#11608)
  Bump micrometer-tracing-bom from 1.0.1 to 1.0.2 (apache#11607)
  3.2 consumer proxy invocation handler (apache#11108)
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

96.0% 96.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@AlbumenJ AlbumenJ left a comment

Choose a reason for hiding this comment

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

LGTM

@AlbumenJ AlbumenJ merged commit 5d07038 into apache:3.2 Feb 25, 2023
mytang0 added a commit to mytang0/dubbo that referenced this pull request Feb 27, 2023
* origin/3.2:
  sync reflect config (apache#11668)
  Fix qos command remote check (apache#11506)
  Fix license check
  Add 'label match' support for override and tag rules (apache#11094)
  Dubbo maven plugin with native (apache#11540)
  fix: fix observation spi config (apache#11660)
  Update .licenserc.yaml
  fix tri wrapper pack npe (apache#11656)
  remove duplicate flowcontroller listener (apache#11642)
  Metrics RT count optimization (apache#11628)
  Observability task: registration center (apache#11493)
  Migration bugfix & optimization (apache#11629)
  Fix service name mapping check failed (apache#11643)
  fix: executor (apache#11652)
  Fix license check
  fixed broken link readme.md (apache#11641)
lcb11 pushed a commit to lcb11/dubbo that referenced this pull request Mar 31, 2023
* Metrics RT count optimization

* Fix camel case naming problem
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.

3 participants