NewLeastActiveLoadBalance#65
Merged
zonghaishang merged 9 commits intoapache:masterfrom Jun 13, 2019
zonghaishang:loadbalance_leastactive
Merged
NewLeastActiveLoadBalance#65zonghaishang merged 9 commits intoapache:masterfrom zonghaishang:loadbalance_leastactive
zonghaishang merged 9 commits intoapache:masterfrom
zonghaishang:loadbalance_leastactive
Conversation
hxmhlt
reviewed
Jun 3, 2019
| "github.com/dubbo/go-for-apache-dubbo/filter" | ||
| "github.com/dubbo/go-for-apache-dubbo/protocol" | ||
| "math/rand" | ||
| ) |
|
|
||
| const ( | ||
| leastActive = "leastactive" | ||
| ) |
| "github.com/dubbo/go-for-apache-dubbo/common" | ||
| "sync" | ||
| "sync/atomic" | ||
| ) |
|
|
||
| var ( | ||
| methodStatistics = sync.Map{} // url -> { methodName : RpcStatus} | ||
| ) |
| "github.com/dubbo/go-for-apache-dubbo/common/extension" | ||
| "github.com/dubbo/go-for-apache-dubbo/filter" | ||
| "github.com/dubbo/go-for-apache-dubbo/protocol" | ||
| ) |
| ) | ||
|
|
||
| const active = "active" | ||
|
|
| @@ -0,0 +1,68 @@ | |||
| // Licensed under the Apache License, Version 2.0 (the "License"); | |||
Contributor
There was a problem hiding this comment.
这个文件放到protocol根目录下面吧。放到filter分类有点怪
AlexStocks
reviewed
Jun 3, 2019
cluster/loadbalance/least_active.go
Outdated
| func (lb *leastActiveLoadBalance) Select(invokers []protocol.Invoker, invocation protocol.Invocation) protocol.Invoker { | ||
|
|
||
| count := len(invokers) | ||
| if invokers == nil || count == 0 { |
Contributor
There was a problem hiding this comment.
函数开始第一行不要空行,这里也是只判断下 if count == 0 即可
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
==========================================
+ Coverage 61.95% 62.19% +0.24%
==========================================
Files 52 54 +2
Lines 3517 3574 +57
==========================================
+ Hits 2179 2223 +44
- Misses 1117 1128 +11
- Partials 221 223 +2
Continue to review full report at Codecov.
|
hxmhlt
reviewed
Jun 13, 2019
| @@ -1,6 +1,7 @@ | |||
| module github.com/apache/dubbo-go | |||
|
|
|||
| require ( | |||
Contributor
There was a problem hiding this comment.
why require github.com/dubbo/go-for-apache-dubbo?
Member
Author
There was a problem hiding this comment.
This should be left over from history. Trying to delete it will cause ci to fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.