Commit a794f439 authored by TousakaRin's avatar TousakaRin

Show RecentErr and nbreak only in channel_conn

parent ead9f8bc
......@@ -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";
......
......@@ -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);
......
......@@ -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";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment