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
a794f439
Commit
a794f439
authored
Nov 05, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show RecentErr and nbreak only in channel_conn
parent
ead9f8bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
22 deletions
+18
-22
connections_service.cpp
src/brpc/builtin/connections_service.cpp
+18
-19
circuit_breaker.h
src/brpc/circuit_breaker.h
+0
-2
socket.cpp
src/brpc/socket.cpp
+0
-1
No files found.
src/brpc/builtin/connections_service.cpp
View file @
a794f439
...
...
@@ -108,7 +108,7 @@ static std::string BriefName(const std::string& cname) {
void
ConnectionsService
::
PrintConnections
(
std
::
ostream
&
os
,
const
std
::
vector
<
SocketId
>&
conns
,
bool
use_html
,
const
Server
*
server
,
bool
need_local
)
const
{
bool
use_html
,
const
Server
*
server
,
bool
is_channel_conn
)
const
{
if
(
conns
.
empty
())
{
return
;
}
...
...
@@ -116,14 +116,14 @@ void ConnectionsService::PrintConnections(
os
<<
"<table class=
\"
gridtable sortable
\"
border=
\"
1
\"
><tr>"
"<th>CreatedTime</th>"
"<th>RemoteSide</th>"
;
if
(
need_local
)
{
os
<<
"<th>Local</th>"
;
if
(
is_channel_conn
)
{
os
<<
"<th>Local</th>"
"<th>RecentErr</th>"
"<th>nbreak</th>"
;
}
os
<<
"<th>SSL</th>"
"<th>Protocol</th>"
"<th>fd</th>"
"<th>recent_err</th>"
"<th>nbreak</th>"
"<th>InBytes/s</th>"
"<th>In/s</th>"
"<th>InBytes/m</th>"
...
...
@@ -137,10 +137,10 @@ void ConnectionsService::PrintConnections(
"</tr>
\n
"
;
}
else
{
os
<<
"CreatedTime |RemoteSide |"
;
if
(
need_local
)
{
os
<<
"Local|"
;
if
(
is_channel_conn
)
{
os
<<
"Local|
RecentErr|nbreak|
"
;
}
os
<<
"SSL|Protocol |fd |
recent_err|nbreak|
"
os
<<
"SSL|Protocol |fd |"
"InBytes/s|In/s |InBytes/m |In/m |"
"OutBytes/s|Out/s |OutBytes/m|Out/m |"
"Rtt/Var(ms)|SocketId
\n
"
;
...
...
@@ -173,15 +173,14 @@ void ConnectionsService::PrintConnections(
if
(
failed
)
{
os
<<
min_width
(
"Broken"
,
26
)
<<
bar
<<
min_width
(
NameOfPoint
(
ptr
->
remote_side
()),
19
)
<<
bar
;
if
(
need_local
)
{
os
<<
min_width
(
ptr
->
local_side
().
port
,
5
)
<<
bar
;
if
(
is_channel_conn
)
{
os
<<
min_width
(
ptr
->
local_side
().
port
,
5
)
<<
bar
<<
min_width
(
ptr
->
recent_error_count
(),
10
)
<<
bar
<<
min_width
(
ptr
->
isolated_times
(),
7
)
<<
bar
;
}
os
<<
min_width
(
"-"
,
3
)
<<
bar
<<
min_width
(
"-"
,
12
)
<<
bar
<<
min_width
(
"-"
,
5
)
<<
bar
<<
min_width
(
ptr
->
recent_error_count
(),
11
)
<<
bar
<<
min_width
(
ptr
->
isolated_times
(),
7
)
<<
bar
<<
min_width
(
"-"
,
9
)
<<
bar
<<
min_width
(
"-"
,
6
)
<<
bar
<<
min_width
(
"-"
,
10
)
<<
bar
...
...
@@ -272,12 +271,14 @@ void ConnectionsService::PrintConnections(
strcpy
(
rtt_display
,
"-"
);
}
os
<<
bar
<<
min_width
(
NameOfPoint
(
ptr
->
remote_side
()),
19
)
<<
bar
;
if
(
need_local
)
{
if
(
is_channel_conn
)
{
if
(
ptr
->
local_side
().
port
>
0
)
{
os
<<
min_width
(
ptr
->
local_side
().
port
,
5
)
<<
bar
;
}
else
{
os
<<
min_width
(
"-"
,
5
)
<<
bar
;
}
os
<<
min_width
(
ptr
->
recent_error_count
(),
10
)
<<
bar
<<
min_width
(
ptr
->
isolated_times
(),
7
)
<<
bar
;
}
os
<<
SSLStateToYesNo
(
ptr
->
ssl_state
(),
use_html
)
<<
bar
;
char
protname
[
32
];
...
...
@@ -293,9 +294,7 @@ void ConnectionsService::PrintConnections(
}
else
{
os
<<
min_width
(
"-"
,
5
)
<<
bar
;
}
os
<<
min_width
(
ptr
->
recent_error_count
(),
11
)
<<
bar
<<
min_width
(
ptr
->
isolated_times
(),
7
)
<<
bar
<<
min_width
(
stat
.
in_size_s
,
9
)
<<
bar
os
<<
min_width
(
stat
.
in_size_s
,
9
)
<<
bar
<<
min_width
(
stat
.
in_num_messages_s
,
6
)
<<
bar
<<
min_width
(
stat
.
in_size_m
,
10
)
<<
bar
<<
min_width
(
stat
.
in_num_messages_m
,
8
)
<<
bar
...
...
@@ -374,7 +373,7 @@ void ConnectionsService::default_method(
conns
.
insert
(
conns
.
end
(),
internal_conns
.
begin
(),
internal_conns
.
end
());
}
os
<<
"server_connection_count: "
<<
num_conns
<<
'\n'
;
PrintConnections
(
os
,
conns
,
use_html
,
server
,
false
/*
need_local
*/
);
PrintConnections
(
os
,
conns
,
use_html
,
server
,
false
/*
is_channel_conn
*/
);
if
(
has_uncopied
)
{
// Notice that we don't put the link of givemeall directly because
// people seeing the link are very likely to click it which may be
...
...
@@ -387,7 +386,7 @@ void ConnectionsService::default_method(
SocketMapList
(
&
conns
);
os
<<
(
use_html
?
"<br>
\n
"
:
"
\n
"
)
<<
"channel_connection_count: "
<<
GetChannelConnectionCount
()
<<
'\n'
;
PrintConnections
(
os
,
conns
,
use_html
,
server
,
true
/*
need_local
*/
);
PrintConnections
(
os
,
conns
,
use_html
,
server
,
true
/*
is_channel_conn
*/
);
if
(
use_html
)
{
os
<<
"</body></html>
\n
"
;
...
...
src/brpc/circuit_breaker.h
View file @
a794f439
...
...
@@ -66,8 +66,6 @@ private:
bool
OnCallEnd
(
int
error_code
,
int64_t
latency
);
void
Reset
();
int
health_score
()
const
;
private
:
int64_t
UpdateLatency
(
int64_t
latency
);
bool
UpdateErrorCost
(
int64_t
latency
,
int64_t
ema_latency
);
...
...
src/brpc/socket.cpp
View file @
a794f439
...
...
@@ -905,7 +905,6 @@ int Socket::SetFailed() {
void
Socket
::
FeedbackCircuitBreaker
(
int
error_code
,
int64_t
latency_us
)
{
if
(
!
GetOrNewSharedPart
()
->
circuit_breaker
.
OnCallEnd
(
error_code
,
latency_us
))
{
if
(
SetFailed
(
main_socket_id
())
==
0
)
{
SetFailed
(
main_socket_id
());
LOG
(
ERROR
)
<<
"Socket["
<<
*
this
<<
"] isolated by circuit breaker"
;
}
}
...
...
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