Interface TimeWindow


  • public interface TimeWindow
    • Method Detail

      • record

        boolean record()
        Records an invocation attempt.
        Returns:
        whether the invocation should be allowed
      • createFixed

        static TimeWindow createFixed​(Stopwatch stopwatch,
                                      int maxInvocations,
                                      long timeWindowInMillis,
                                      long minSpacingInMillis)
      • createRolling

        static TimeWindow createRolling​(Stopwatch stopwatch,
                                        int maxInvocations,
                                        long timeWindowInMillis,
                                        long minSpacingInMillis)
      • createSmooth

        static TimeWindow createSmooth​(Stopwatch stopwatch,
                                       int maxInvocations,
                                       long timeWindowInMillis,
                                       long minSpacingInMillis)