Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
4eb18301
Commit
4eb18301
authored
Mar 09, 2018
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix for GetStride()
parent
83daab16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
weighted_round_robin_load_balancer.cpp
src/brpc/policy/weighted_round_robin_load_balancer.cpp
+3
-0
No files found.
src/brpc/policy/weighted_round_robin_load_balancer.cpp
View file @
4eb18301
...
...
@@ -49,6 +49,9 @@ bool IsCoprime(uint32_t num1, uint32_t num2) {
// Get a reasonable stride according to weights configured of servers.
uint32_t
GetStride
(
const
uint32_t
weight_sum
,
const
uint32_t
num
)
{
if
(
weight_sum
==
1
)
{
return
1
;
}
uint32_t
average_weight
=
weight_sum
/
num
;
auto
iter
=
std
::
lower_bound
(
prime_stride
.
begin
(),
prime_stride
.
end
(),
average_weight
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment