private void sendRequest(ChannelHandlerContext ctx) {
      requestId++;
      long globalId = totalRequestCount.incrementAndGet();
      Channel channel = ctx.channel();
      String hostname = ((SocketChannel) channel).remoteAddress().getHostName();
      hostToRequestCount.get(hostname).incrementAndGet();
      logger.trace("Sending request with global ID {} and local ID {} on channel {}", globalId, requestId, channel);
      reset();
      perfClientMetrics.requestRate.mark();
      try {
        Thread.sleep(hostToSleepTime.get(hostname));
      } catch (InterruptedException e) {
        logger.error("Interrupted with exception:", e);
      }
      ctx.writeAndFlush(request);
      if (request.method().equals(HttpMethod.POST)) {
        ctx.writeAndFlush(chunkedInput);
      }
      logger.trace("Request {} scheduled to be sent on channel {}", requestId, ctx.channel());
    }
Sends the request according to the configuration.
@param ctx the {@link ChannelHandlerContext} to use to send the request.
ambry-tools/src/main/java/com/github/ambry/tools/perf/rest/NettyPerfClient.java