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

Refactor least active balance algorithm. #4342

Merged
merged 6 commits into from
Feb 8, 2023
Merged

Refactor least active balance algorithm. #4342

merged 6 commits into from
Feb 8, 2023

Conversation

damonxue
Copy link
Contributor

@damonxue damonxue commented Feb 1, 2023

The previous version did not record historical access and could not be used as the least active upstream node.

countMap.keySet().forEach(key -> {
           // After several times, domains in the countMap with only the most frequently visited or none
            if (!domainList.keySet().contains(key)) {
                countMap.remove(key);
            }
        });

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@codecov-commenter
Copy link

Codecov Report

Merging #4342 (46d3b72) into master (23876bf) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #4342      +/-   ##
============================================
- Coverage     68.25%   68.20%   -0.05%     
  Complexity     7516     7516              
============================================
  Files          1020     1020              
  Lines         28831    28823       -8     
  Branches       2585     2580       -5     
============================================
- Hits          19678    19660      -18     
- Misses         7613     7624      +11     
+ Partials       1540     1539       -1     
Impacted Files Coverage Δ
...henyu/loadbalancer/spi/LeastActiveLoadBalance.java 100.00% <100.00%> (+40.90%) ⬆️
...che/shenyu/sync/data/http/HttpSyncDataService.java 70.40% <0.00%> (-11.23%) ⬇️
...a/org/apache/shenyu/common/utils/VersionUtils.java 21.27% <0.00%> (-6.39%) ⬇️
...rg/apache/shenyu/plugin/rewrite/RewritePlugin.java 66.66% <0.00%> (-5.56%) ⬇️
...in/response/strategy/NettyClientMessageWriter.java 71.42% <0.00%> (-3.58%) ⬇️
...a/org/apache/shenyu/plugin/mock/util/MockUtil.java 77.55% <0.00%> (-2.05%) ⬇️
...yu/admin/service/impl/PluginHandleServiceImpl.java 74.07% <0.00%> (-1.86%) ⬇️
...client/brpc/BrpcContextRefreshedEventListener.java 68.57% <0.00%> (-1.43%) ⬇️
...henyu/common/cache/MemorySafeWindowTinyLFUMap.java 73.33% <0.00%> (ø)

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

@damonxue
Copy link
Contributor Author

damonxue commented Feb 2, 2023

pls review. @yu199195

@yu199195 yu199195 added this to the 2.6.0 milestone Feb 8, 2023
@yu199195 yu199195 merged commit bf2a1f6 into apache:master Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants