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
1737f164
Commit
1737f164
authored
Nov 08, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify default config value of circuit_breaker
parent
a794f439
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
circuit_breaker.cpp
src/brpc/circuit_breaker.cpp
+7
-3
No files found.
src/brpc/circuit_breaker.cpp
View file @
1737f164
...
...
@@ -21,9 +21,9 @@
namespace
brpc
{
DEFINE_int32
(
circuit_breaker_short_window_size
,
500
,
DEFINE_int32
(
circuit_breaker_short_window_size
,
1
500
,
"Short window sample size."
);
DEFINE_int32
(
circuit_breaker_long_window_size
,
1
000
,
DEFINE_int32
(
circuit_breaker_long_window_size
,
3
000
,
"Long window sample size."
);
DEFINE_int32
(
circuit_breaker_short_window_error_percent
,
10
,
"The maximum error rate allowed by the short window, ranging from 0-99."
);
...
...
@@ -39,6 +39,8 @@ DEFINE_int32(circuit_breaker_min_isolation_duration_ms, 100,
"Minimum isolation duration in milliseconds"
);
DEFINE_int32
(
circuit_breaker_max_isolation_duration_ms
,
30000
,
"Maximum isolation duration in milliseconds"
);
DEFINE_double
(
circuit_breaker_epsilon_value
,
0.02
,
"ema_alpha = 1 - std::pow(epsilon, 1.0 / window_size)"
);
namespace
{
// EPSILON is used to generate the smoothing coefficient when calculating EMA.
...
...
@@ -51,7 +53,9 @@ namespace {
// when window_size = 1000,
// EPSILON = 0.1, smooth = 0.9977
// EPSILON = 0.3, smooth = 0.9987
const
double
EPSILON
=
0.1
;
#define EPSILON (FLAGS_circuit_breaker_epsilon_value)
}
// namepace
CircuitBreaker
::
EmaErrorRecorder
::
EmaErrorRecorder
(
int
window_size
,
...
...
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