@Test public void testClientResponseStatsUpdate() throws IOException, InterruptedException, KeeperException { try (ZooKeeper zk = createClient()) { BufferStats clientResponseStats = serverFactory.getZooKeeperServer().serverStats().getClientResponseStats(); assertThat("Last client response size should be initialized with INIT_VALUE", clientResponseStats.getLastBufferSize(), equalTo(BufferStats.INIT_VALUE)); zk.create("/a", "test".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertThat("Last client response size should be greater then zero after client request was performed", clientResponseStats.getLastBufferSize(), greaterThan(0)); } }
@Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); }
NIOServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } }
NIOServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NIOServerCnxn(ZooKeeperServer zk, SocketChannel sock,
                         SelectionKey sk, NIOServerCnxnFactory factory,
                         SelectorThread selectorThread); }
NIOServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NIOServerCnxn(ZooKeeperServer zk, SocketChannel sock,
                         SelectionKey sk, NIOServerCnxnFactory factory,
                         SelectorThread selectorThread); void sendCloseSession(); void sendBuffer(ByteBuffer bb); boolean isSelectable(); void disableSelectable(); void enableSelectable(); void disableRecv(); void enableRecv(); long getOutstandingRequests(); int getSessionTimeout(); @Override String toString(); @Override void close(); static void closeSock(SocketChannel sock); @Override void sendResponse(ReplyHeader h, Record r, String tag); @Override void process(WatchedEvent event); @Override long getSessionId(); @Override void setSessionId(long sessionId); @Override void setSessionTimeout(int sessionTimeout); @Override int getInterestOps(); @Override InetSocketAddress getRemoteSocketAddress(); InetAddress getSocketAddress(); @Override boolean isSecure(); @Override Certificate[] getClientCertificateChain(); @Override void setClientCertificateChain(Certificate[] chain); }
NIOServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NIOServerCnxn(ZooKeeperServer zk, SocketChannel sock,
                         SelectionKey sk, NIOServerCnxnFactory factory,
                         SelectorThread selectorThread); void sendCloseSession(); void sendBuffer(ByteBuffer bb); boolean isSelectable(); void disableSelectable(); void enableSelectable(); void disableRecv(); void enableRecv(); long getOutstandingRequests(); int getSessionTimeout(); @Override String toString(); @Override void close(); static void closeSock(SocketChannel sock); @Override void sendResponse(ReplyHeader h, Record r, String tag); @Override void process(WatchedEvent event); @Override long getSessionId(); @Override void setSessionId(long sessionId); @Override void setSessionTimeout(int sessionTimeout); @Override int getInterestOps(); @Override InetSocketAddress getRemoteSocketAddress(); InetAddress getSocketAddress(); @Override boolean isSecure(); @Override Certificate[] getClientCertificateChain(); @Override void setClientCertificateChain(Certificate[] chain);  }