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
a9679e24
Commit
a9679e24
authored
Jul 18, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify the algorithm: 1.use the actual measured qps 2.re-measure minRtt every random time
parent
77d54240
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
gradient_concurrency_limiter.cpp
src/brpc/policy/gradient_concurrency_limiter.cpp
+0
-0
gradient_concurrency_limiter.h
src/brpc/policy/gradient_concurrency_limiter.h
+11
-14
No files found.
src/brpc/policy/gradient_concurrency_limiter.cpp
View file @
a9679e24
This diff is collapsed.
Click to expand it.
src/brpc/policy/gradient_concurrency_limiter.h
View file @
a9679e24
...
...
@@ -52,26 +52,23 @@ private:
int64_t
total_succ_us
;
};
struct
WindowSnap
{
WindowSnap
(
int64_t
latency_us
,
int32_t
concurrency
,
int32_t
succ_req
)
:
avg_latency_us
(
latency_us
)
,
actual_concurrency
(
concurrency
)
,
total_succ_req
(
succ_req
)
{}
int64_t
avg_latency_us
;
int32_t
actual_concurrency
;
int32_t
total_succ_req
;
};
void
AddSample
(
int
error_code
,
int64_t
latency_us
,
int64_t
sampling_time_us
);
int
NextResetCount
();
//NOT thread-safe, should be called in AddSample()
void
UpdateConcurrency
();
// The following methods are not thread safe and can only be called
// in AppSample()
void
UpdateConcurrency
(
int64_t
sampling_time_us
);
void
UpdateMinLatency
(
int64_t
latency_us
);
void
UpdateQps
(
int32_t
succ_count
,
int64_t
sampling_time_us
);
void
ResetSampleWindow
(
int64_t
sampling_time_us
);
void
AddMinLatency
(
int64_t
latency_us
);
SampleWindow
_sw
;
butil
::
BoundedQueue
<
WindowSnap
>
_ws_queue
;
uint32_t
_ws_index
;
int32_t
_unused_max_concurrency
;
int
_reset_count
;
int64_t
_min_latency_us
;
const
double
_smooth
;
int32_t
_ema_qps
;
butil
::
Mutex
_sw_mutex
;
bvar
::
PassiveStatus
<
int32_t
>
_max_concurrency_bvar
;
butil
::
atomic
<
int64_t
>
BAIDU_CACHELINE_ALIGNMENT
_last_sampling_time_us
;
...
...
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