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) { ...@@ -108,7 +108,7 @@ static std::string BriefName(const std::string& cname) {
void ConnectionsService::PrintConnections( void ConnectionsService::PrintConnections(
std::ostream& os, const std::vector<SocketId>& conns, 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()) { if (conns.empty()) {
return; return;
} }
...@@ -116,14 +116,14 @@ void ConnectionsService::PrintConnections( ...@@ -116,14 +116,14 @@ void ConnectionsService::PrintConnections(
os << "<table class=\"gridtable sortable\" border=\"1\"><tr>" os << "<table class=\"gridtable sortable\" border=\"1\"><tr>"
"<th>CreatedTime</th>" "<th>CreatedTime</th>"
"<th>RemoteSide</th>"; "<th>RemoteSide</th>";
if (need_local) { if (is_channel_conn) {
os << "<th>Local</th>"; os << "<th>Local</th>"
"<th>RecentErr</th>"
"<th>nbreak</th>";
} }
os << "<th>SSL</th>" os << "<th>SSL</th>"
"<th>Protocol</th>" "<th>Protocol</th>"
"<th>fd</th>" "<th>fd</th>"
"<th>recent_err</th>"
"<th>nbreak</th>"
"<th>InBytes/s</th>" "<th>InBytes/s</th>"
"<th>In/s</th>" "<th>In/s</th>"
"<th>InBytes/m</th>" "<th>InBytes/m</th>"
...@@ -137,10 +137,10 @@ void ConnectionsService::PrintConnections( ...@@ -137,10 +137,10 @@ void ConnectionsService::PrintConnections(
"</tr>\n"; "</tr>\n";
} else { } else {
os << "CreatedTime |RemoteSide |"; os << "CreatedTime |RemoteSide |";
if (need_local) { if (is_channel_conn) {
os << "Local|"; os << "Local|RecentErr|nbreak|";
} }
os << "SSL|Protocol |fd |recent_err|nbreak|" os << "SSL|Protocol |fd |"
"InBytes/s|In/s |InBytes/m |In/m |" "InBytes/s|In/s |InBytes/m |In/m |"
"OutBytes/s|Out/s |OutBytes/m|Out/m |" "OutBytes/s|Out/s |OutBytes/m|Out/m |"
"Rtt/Var(ms)|SocketId\n"; "Rtt/Var(ms)|SocketId\n";
...@@ -173,15 +173,14 @@ void ConnectionsService::PrintConnections( ...@@ -173,15 +173,14 @@ void ConnectionsService::PrintConnections(
if (failed) { if (failed) {
os << min_width("Broken", 26) << bar os << min_width("Broken", 26) << bar
<< min_width(NameOfPoint(ptr->remote_side()), 19) << bar; << min_width(NameOfPoint(ptr->remote_side()), 19) << bar;
if (need_local) { if (is_channel_conn) {
os << min_width(ptr->local_side().port, 5) << bar; 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 os << min_width("-", 3) << bar
<< min_width("-", 12) << bar << min_width("-", 12) << bar
<< min_width("-", 5) << 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("-", 9) << bar
<< min_width("-", 6) << bar << min_width("-", 6) << bar
<< min_width("-", 10) << bar << min_width("-", 10) << bar
...@@ -272,12 +271,14 @@ void ConnectionsService::PrintConnections( ...@@ -272,12 +271,14 @@ void ConnectionsService::PrintConnections(
strcpy(rtt_display, "-"); strcpy(rtt_display, "-");
} }
os << bar << min_width(NameOfPoint(ptr->remote_side()), 19) << bar; os << bar << min_width(NameOfPoint(ptr->remote_side()), 19) << bar;
if (need_local) { if (is_channel_conn) {
if (ptr->local_side().port > 0) { if (ptr->local_side().port > 0) {
os << min_width(ptr->local_side().port, 5) << bar; os << min_width(ptr->local_side().port, 5) << bar;
} else { } else {
os << min_width("-", 5) << bar; 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; os << SSLStateToYesNo(ptr->ssl_state(), use_html) << bar;
char protname[32]; char protname[32];
...@@ -293,9 +294,7 @@ void ConnectionsService::PrintConnections( ...@@ -293,9 +294,7 @@ void ConnectionsService::PrintConnections(
} else { } else {
os << min_width("-", 5) << bar; os << min_width("-", 5) << bar;
} }
os << min_width(ptr->recent_error_count(), 11) << bar os << min_width(stat.in_size_s, 9) << bar
<< min_width(ptr->isolated_times(), 7) << bar
<< min_width(stat.in_size_s, 9) << bar
<< min_width(stat.in_num_messages_s, 6) << bar << min_width(stat.in_num_messages_s, 6) << bar
<< min_width(stat.in_size_m, 10) << bar << min_width(stat.in_size_m, 10) << bar
<< min_width(stat.in_num_messages_m, 8) << bar << min_width(stat.in_num_messages_m, 8) << bar
...@@ -374,7 +373,7 @@ void ConnectionsService::default_method( ...@@ -374,7 +373,7 @@ void ConnectionsService::default_method(
conns.insert(conns.end(), internal_conns.begin(), internal_conns.end()); conns.insert(conns.end(), internal_conns.begin(), internal_conns.end());
} }
os << "server_connection_count: " << num_conns << '\n'; 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) { if (has_uncopied) {
// Notice that we don't put the link of givemeall directly because // 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 // people seeing the link are very likely to click it which may be
...@@ -387,7 +386,7 @@ void ConnectionsService::default_method( ...@@ -387,7 +386,7 @@ void ConnectionsService::default_method(
SocketMapList(&conns); SocketMapList(&conns);
os << (use_html ? "<br>\n" : "\n") os << (use_html ? "<br>\n" : "\n")
<< "channel_connection_count: " << GetChannelConnectionCount() << '\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) { if (use_html) {
os << "</body></html>\n"; os << "</body></html>\n";
......
...@@ -66,8 +66,6 @@ private: ...@@ -66,8 +66,6 @@ private:
bool OnCallEnd(int error_code, int64_t latency); bool OnCallEnd(int error_code, int64_t latency);
void Reset(); void Reset();
int health_score() const;
private: private:
int64_t UpdateLatency(int64_t latency); int64_t UpdateLatency(int64_t latency);
bool UpdateErrorCost(int64_t latency, int64_t ema_latency); bool UpdateErrorCost(int64_t latency, int64_t ema_latency);
......
...@@ -905,7 +905,6 @@ int Socket::SetFailed() { ...@@ -905,7 +905,6 @@ int Socket::SetFailed() {
void Socket::FeedbackCircuitBreaker(int error_code, int64_t latency_us) { void Socket::FeedbackCircuitBreaker(int error_code, int64_t latency_us) {
if (!GetOrNewSharedPart()->circuit_breaker.OnCallEnd(error_code, latency_us)) { if (!GetOrNewSharedPart()->circuit_breaker.OnCallEnd(error_code, latency_us)) {
if (SetFailed(main_socket_id()) == 0) { if (SetFailed(main_socket_id()) == 0) {
SetFailed(main_socket_id());
LOG(ERROR) << "Socket[" << *this << "] isolated by circuit breaker"; 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