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 #4469]add shortestResponseLoadBalancer #4488

Merged
merged 6 commits into from
Mar 21, 2023

Conversation

HaiqiQin
Copy link
Contributor

#4469
add shortestResponseLoadBalancer

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2023

Codecov Report

Merging #4488 (43acf03) into master (74c5022) will decrease coverage by 0.08%.
The diff coverage is 49.23%.

@@             Coverage Diff              @@
##             master    #4488      +/-   ##
============================================
- Coverage     68.11%   68.03%   -0.08%     
- Complexity     7549     7561      +12     
============================================
  Files          1027     1028       +1     
  Lines         29266    29370     +104     
  Branches       2635     2652      +17     
============================================
+ Hits          19934    19982      +48     
- Misses         7755     7804      +49     
- Partials       1577     1584       +7     
Impacted Files Coverage Δ
...g/apache/shenyu/web/loader/ShenyuPluginLoader.java 59.66% <7.69%> (-15.16%) ⬇️
.../org/apache/shenyu/plugin/divide/DividePlugin.java 57.89% <40.00%> (-2.40%) ⬇️
...rg/apache/shenyu/web/handler/ShenyuWebHandler.java 91.30% <40.00%> (-4.09%) ⬇️
.../apache/shenyu/web/loader/ShenyuLoaderService.java 72.41% <73.33%> (-18.07%) ⬇️
...loadbalancer/spi/ShortestResponseLoadBalancer.java 86.48% <86.48%> (ø)
...rg/apache/shenyu/common/enums/LoadBalanceEnum.java 100.00% <100.00%> (ø)
...rg/apache/shenyu/loadbalancer/entity/Upstream.java 93.40% <100.00%> (+0.63%) ⬆️
...pringboot/starter/gateway/ShenyuConfiguration.java 91.30% <100.00%> (ø)

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

@yu199195 yu199195 added this to the 2.6.0 milestone Mar 19, 2023
@@ -110,8 +114,15 @@ protected Mono<Void> doExecute(final ServerWebExchange exchange, final ShenyuPlu
exchange.getAttributes().put(Constants.RETRY_STRATEGY, StringUtils.defaultString(ruleHandle.getRetryStrategy(), RetryEnum.CURRENT.getName()));
exchange.getAttributes().put(Constants.LOAD_BALANCE, StringUtils.defaultString(ruleHandle.getLoadBalance(), LoadBalanceEnum.RANDOM.getName()));
exchange.getAttributes().put(Constants.DIVIDE_SELECTOR_ID, selector.getId());
return ruleHandle.getLoadBalance().equals(P2C) ? chain.execute(exchange).doOnSuccess(e -> responseTrigger(upstream
)).doOnError(throwable -> responseTrigger(upstream)) : chain.execute(exchange);
if (ruleHandle.getLoadBalance().equals(P2C)) {
Copy link
Member

Choose a reason for hiding this comment

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

whats mean ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Different strategies require different methods to be implemented.Does it need improvement?

@yu199195 yu199195 merged commit deeb857 into apache:master Mar 21, 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.

None yet

3 participants