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

NewLeastActiveLoadBalance #65

Merged
merged 9 commits into from
Jun 13, 2019
Merged

NewLeastActiveLoadBalance #65

merged 9 commits into from
Jun 13, 2019

Conversation

zonghaishang
Copy link
Member

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jun 3, 2019

CLA assistant check
All committers have signed the CLA.

"github.com/dubbo/go-for-apache-dubbo/filter"
"github.com/dubbo/go-for-apache-dubbo/protocol"
"math/rand"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

import format


const (
leastActive = "leastactive"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

const format

"github.com/dubbo/go-for-apache-dubbo/common"
"sync"
"sync/atomic"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

import format


var (
methodStatistics = sync.Map{} // url -> { methodName : RpcStatus}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

methodStatistics sync.Map

"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"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

import format

)

const active = "active"

Copy link
Contributor

Choose a reason for hiding this comment

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

const format

@@ -0,0 +1,68 @@
// Licensed under the Apache License, Version 2.0 (the "License");
Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件放到protocol根目录下面吧。放到filter分类有点怪

func (lb *leastActiveLoadBalance) Select(invokers []protocol.Invoker, invocation protocol.Invocation) protocol.Invoker {

count := len(invokers)
if invokers == nil || count == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

函数开始第一行不要空行,这里也是只判断下 if count == 0 即可

@codecov-io
Copy link

codecov-io commented Jun 13, 2019

Codecov Report

Merging #65 into master will increase coverage by 0.24%.
The diff coverage is 77.19%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
filter/impl/active_filter.go 18.18% <18.18%> (ø)
cluster/loadbalance/least_active.go 91.3% <91.3%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17d73c5...b2585fc. Read the comment docs.

go.mod Outdated
@@ -1,6 +1,7 @@
module github.com/apache/dubbo-go

require (
github.com/dubbo/go-for-apache-dubbo v1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

why require github.com/dubbo/go-for-apache-dubbo?

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be left over from history. Trying to delete it will cause ci to fail

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed it.

@zonghaishang zonghaishang merged commit 2b5f5e4 into apache:master Jun 13, 2019
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.

5 participants