the main thread is running a loop to update the permits approx every second, this is existing code 

        while (benchmarkEndTime > currentTs) {
            rateLimiter.updateActivePermits(currentTs);
            Thread.yield();
             ...

which does a drain followed by a release (back to initial conditions) about every second. That is all in existing code. I extended the one permit "type" to apply to all the threads rather than just the ClientThread.