HBASE-21610, numOpenConnections metric is set to -1 when zero server channel exist
This commit is contained in:
parent
8991877bb2
commit
787567336a
|
@ -169,8 +169,9 @@ 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 allChannels.size() - 1;
|
||||
return channelsCount > 0 ? channelsCount - 1 : channelsCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue