private EventExecutor chooseWithLeastConns() {
            EventExecutor leastExec = null;
            int leastValue = Integer.MAX_VALUE;

            Map<Thread, Integer> connsPer = groupMetrics.connectionsPerEventLoop();

            // Shuffle the list of executors each time so that if they all have the same number of connections, then
            // we don't favour the 1st one.
            Collections.shuffle(executors, ThreadLocalRandom.current());

            for (EventExecutor executor : executors) {
                int value = connsPer.getOrDefault(executor, 0);
                if (value < leastValue) {
                    leastValue = value;
                    leastExec = executor;
                }
            }

            // If none chosen, then just use first.
            if (leastExec == null) {
                leastExec = executors.get(0);
            }

            if (LOG.isDebugEnabled()) {
                LOG.debug(
                        "Chose eventloop: {}, leastValue={}, connsPer={}",
                        String.valueOf(leastExec),
                        leastValue,
                        String.valueOf(connsPer));
            }

            return leastExec;
        }
User: michaels@netflix.com
Date: 2/7/17
Time: 2:44 PM
zuul-core/src/main/java/com/netflix/netty/common/LeastConnsEventLoopChooserFactory.java