public static long getNumberOfPendingTasks(final EventLoopGroup eventLoopGroup) {
    int index = 0;
    long totalPendingTasks = 0;
    for (final EventExecutor eventExecutor : eventLoopGroup) {
      if (eventExecutor instanceof SingleThreadEventExecutor) {
        int pendingTasks = ((SingleThreadEventExecutor) eventExecutor).pendingTasks();
        totalPendingTasks += pendingTasks;
        logger.debug("EventLoop-{} pending tasks: {}", index, pendingTasks);
        index++;
      } else {
        logger.warn("EventLoop is not SingleThreadEventExecutor");
        break;
      }
    }
    return totalPendingTasks;
  }
Get number of total pending tasks in Netty EventLoopGroup.
ambry-utils/src/main/java/com/github/ambry/utils/Utils.java