@Override public void run() { for (int i = 0; i < n; i++) { try { final long start = System.currentTimeMillis(); // LOGGER.info("[{}]", start); Sync sync = client.QueryItem( new QueryItemREQ(String.valueOf(i).getBytes("UTF-8")), "test_kv2", new AsyncHandler<TCall<QueryItem_args, QueryItem_result>>() { @Override public void operationCompleted(TCall<QueryItem_args, QueryItem_result> call) { stat(call.getMessage(), start); ok.incrementAndGet(); if (total.incrementAndGet() == n) { countDownLatch.countDown(); } } @Override public void operationFailed( TCall<QueryItem_args, QueryItem_result> call, TException e) { error.incrementAndGet(); if (total.incrementAndGet() == n) { countDownLatch.countDown(); } LOGGER.error("", e); } }); if (sleep > 0 && i % sleep == 0) { sync.sync(); } Thread.sleep(1000); System.out.println(i); } catch (Exception e) { e.printStackTrace(); } } }