@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(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertThat("Last client response size should be greater than 0 after client request was performed", clientResponseStats.getLastBufferSize(), greaterThan(0)); byte[] contents = zk.getData("/a", null, null); assertArrayEquals("unexpected data", "test".getBytes(StandardCharsets.UTF_8), contents); } }
@Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); }
NettyServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } }
NettyServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NettyServerCnxn(Channel channel, ZooKeeperServer zks, NettyServerCnxnFactory factory); }
NettyServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NettyServerCnxn(Channel channel, ZooKeeperServer zks, NettyServerCnxnFactory factory); @Override void close(); @Override long getSessionId(); @Override int getSessionTimeout(); @Override void process(WatchedEvent event); @Override void sendResponse(ReplyHeader h, Record r, String tag); @Override void setSessionId(long sessionId); @Override void sendBuffer(ByteBuffer sendBuffer); @Override void disableRecv(); @Override void enableRecv(); @Override long getOutstandingRequests(); @Override void setSessionTimeout(int sessionTimeout); @Override int getInterestOps(); @Override InetSocketAddress getRemoteSocketAddress(); @Override void sendCloseSession(); @Override boolean isSecure(); @Override Certificate[] getClientCertificateChain(); @Override void setClientCertificateChain(Certificate[] chain); }
NettyServerCnxn extends ServerCnxn { @Override protected ServerStats serverStats() { if (zkServer == null) { return null; } return zkServer.serverStats(); } NettyServerCnxn(Channel channel, ZooKeeperServer zks, NettyServerCnxnFactory factory); @Override void close(); @Override long getSessionId(); @Override int getSessionTimeout(); @Override void process(WatchedEvent event); @Override void sendResponse(ReplyHeader h, Record r, String tag); @Override void setSessionId(long sessionId); @Override void sendBuffer(ByteBuffer sendBuffer); @Override void disableRecv(); @Override void enableRecv(); @Override long getOutstandingRequests(); @Override void setSessionTimeout(int sessionTimeout); @Override int getInterestOps(); @Override InetSocketAddress getRemoteSocketAddress(); @Override void sendCloseSession(); @Override boolean isSecure(); @Override Certificate[] getClientCertificateChain(); @Override void setClientCertificateChain(Certificate[] chain);  }