View Javadoc
1   package ch.qos.logback.core.util;
2   
3   public class FixedRateInvocationGate implements InvocationGate {
4   
5       int rate;
6       int invocationCount = 0;
7   
8       public FixedRateInvocationGate(int rate) {
9           this.rate = rate;
10      }
11  
12      @Override
13      public boolean isTooSoon(long currentTime) {
14          if (invocationCount++ % rate != 0)
15              return true;
16          return false;
17      }
18  
19  }