dubbo-go
dubbo-go copied to clipboard
feat: adaptive load balancer of adaptive service
What this PR does: Provides an adaptive load balancer in unstable environments. This is a component of adaptive service at the consumer side.
Which issue(s) this PR fixes: Fixes #1834
You should pay attention to items below to ensure your pr passes our ci test We do not merge pr with ci tests failed
- [ ] All ut passed (run 'go test ./...' in project root)
- [ ] After go-fmt ed , run 'go fmt project' using goland.
- [ ] Golangci-lint passed, run 'sudo golangci-lint run' in project root.
- [ ] Your new-created file needs to have apache license at the top, like other existed file does.
- [ ] All integration test passed. You can run integration test locally (with docker env). Clone our dubbo-go-samples project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)
This load balancer takes into account the recent request success rate and request latency, the effect is as follows.
Flexible services are turned on at the marked line position. After that the QPS of different configured services is no longer the same, and the CPU load and latency of lower configured services are significantly reduced.



Codecov Report
Merging #2067 (11b348b) into 3.0 (19ddecf) will increase coverage by
0.05%. The diff coverage is93.10%.
:exclamation: Current head 11b348b differs from pull request most recent head 98e894a. Consider uploading reports for the commit 98e894a to get more accurate results
@@ Coverage Diff @@
## 3.0 #2067 +/- ##
==========================================
+ Coverage 44.60% 44.66% +0.05%
==========================================
Files 283 281 -2
Lines 17105 16841 -264
==========================================
- Hits 7630 7522 -108
+ Misses 8669 8532 -137
+ Partials 806 787 -19
| Impacted Files | Coverage Δ | |
|---|---|---|
| cluster/loadbalance/p2c/loadbalance.go | 96.66% <93.10%> (+16.66%) |
:arrow_up: |
| metadata/identifier/base_metadata_identifier.go | 86.48% <0.00%> (-7.64%) |
:arrow_down: |
| ...tocol/rest/server/server_impl/go_restful_server.go | 41.37% <0.00%> (-3.45%) |
:arrow_down: |
| xds/utils/credentials/xds/handshake_info.go | 41.46% <0.00%> (ø) |
|
| ...y/event/service_instances_changed_listener_impl.go | 0.00% <0.00%> (ø) |
|
| remoting/xds/client.go | ||
| remoting/xds/xds_client_factory.go | ||
| common/url.go | 59.50% <0.00%> (+0.45%) |
:arrow_up: |
| config/logger_config.go | 63.33% <0.00%> (+0.62%) |
:arrow_up: |
| registry/nacos/registry.go | 46.00% <0.00%> (+2.68%) |
:arrow_up: |
| ... and 2 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Lgtm, thanks.
Is this PR for client? Will traffic limitation on the server side be submitted in another PR?
Yes.







