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
4962beee
Commit
4962beee
authored
Jul 23, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix code style
parent
e6441cdc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
status_service.cpp
src/brpc/builtin/status_service.cpp
+1
-1
gradient_concurrency_limiter.cpp
src/brpc/policy/gradient_concurrency_limiter.cpp
+1
-1
server.cpp
src/brpc/server.cpp
+15
-14
No files found.
src/brpc/builtin/status_service.cpp
View file @
4962beee
...
...
@@ -95,7 +95,7 @@ void StatusService::default_method(::google::protobuf::RpcController* cntl_base,
<<
"_connection_count
\"
class=
\"
flot-placeholder
\"
></div></div>"
;
}
os
<<
'\n'
;
const
AdaptiveMaxConcurrency
max_concurrency
=
const
AdaptiveMaxConcurrency
&
max_concurrency
=
server
->
options
().
max_concurrency
;
if
(
max_concurrency
==
"constant"
)
{
os
<<
"max_concurrency: "
<<
static_cast
<
int
>
(
max_concurrency
)
<<
'\n'
;
...
...
src/brpc/policy/gradient_concurrency_limiter.cpp
View file @
4962beee
...
...
@@ -184,7 +184,7 @@ void GradientConcurrencyLimiter::UpdateMinLatency(int64_t latency_us) {
void
GradientConcurrencyLimiter
::
UpdateQps
(
int32_t
succ_count
,
int64_t
sampling_time_us
)
{
int32_t
qps
=
double
(
succ_count
)
/
(
sampling_time_us
-
_sw
.
start_time_us
)
double
qps
=
double
(
succ_count
)
/
(
sampling_time_us
-
_sw
.
start_time_us
)
*
1000
*
1000
;
_ema_qps
=
_ema_qps
*
_smooth
+
qps
*
(
1
-
_smooth
);
}
...
...
src/brpc/server.cpp
View file @
4962beee
...
...
@@ -875,20 +875,21 @@ int Server::StartInternal(const butil::ip_t& ip,
bthread_setconcurrency
(
_options
.
num_threads
);
}
if
(
_options
.
max_concurrency
==
"constant"
&&
static_cast
<
int
>
(
_options
.
max_concurrency
)
!=
0
)
{
const
ConcurrencyLimiter
*
constant_cl
=
ConcurrencyLimiterExtension
()
->
Find
(
"constant"
);
if
(
NULL
==
constant_cl
)
{
LOG
(
FATAL
)
<<
"Fail to find ConcurrencyLimiter by `constant'"
;
}
ConcurrencyLimiter
*
cl_copy
=
constant_cl
->
New
();
if
(
NULL
==
cl_copy
)
{
LOG
(
FATAL
)
<<
"Fail to new ConcurrencyLimiter"
;
}
_cl
=
cl_copy
;
_cl
->
MaxConcurrencyRef
()
=
_options
.
max_concurrency
;
}
else
if
(
_options
.
max_concurrency
!=
"constant"
)
{
if
(
_options
.
max_concurrency
==
"constant"
)
{
if
(
static_cast
<
int
>
(
_options
.
max_concurrency
)
!=
0
)
{
const
ConcurrencyLimiter
*
constant_cl
=
ConcurrencyLimiterExtension
()
->
Find
(
"constant"
);
if
(
NULL
==
constant_cl
)
{
LOG
(
FATAL
)
<<
"Fail to find ConcurrencyLimiter by `constant'"
;
}
ConcurrencyLimiter
*
cl_copy
=
constant_cl
->
New
();
if
(
NULL
==
cl_copy
)
{
LOG
(
FATAL
)
<<
"Fail to new ConcurrencyLimiter"
;
}
_cl
=
cl_copy
;
_cl
->
MaxConcurrencyRef
()
=
_options
.
max_concurrency
;
}
}
else
{
const
ConcurrencyLimiter
*
cl
=
NULL
;
cl
=
ConcurrencyLimiterExtension
()
->
Find
(
_options
.
max_concurrency
.
name
().
c_str
());
...
...
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