HBASE-27379 fix numOpenConnections metric is one less than the actual (#4884)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit d7c4447dd2c14bec591597a74f043b36f35bd6a3)
This commit is contained in:
mrzhao 2022-11-16 14:51:55 +08:00 committed by Duo Zhang
parent 53e872e5f1
commit 43b1c9722b

View File

@ -226,9 +226,7 @@ public class NettyRpcServer extends RpcServer {
@Override
public int getNumOpenConnections() {
int channelsCount = allChannels.size();
// allChannels also contains the server channel, so exclude that from the count.
return channelsCount > 0 ? channelsCount - 1 : channelsCount;
return allChannels.size();
}
@Override