Class DurationChecker


  • public class DurationChecker
    extends Object
    Helper class that is used to check whether time that has passed since previous event is exceeding a threshold
    Since:
    7.7.0
    • Constructor Detail

      • DurationChecker

        public DurationChecker​(int defaultThresholdInSeconds)
      • DurationChecker

        public DurationChecker​(int defaultThresholdInSeconds,
                               LongSupplier nanoTime)
    • Method Detail

      • getThresholdInSeconds

        public int getThresholdInSeconds()
        Amount of seconds that should pass between the events
      • thresholdElapsed

        public boolean thresholdElapsed()
        Checks whether amount of time that is passed between the events has exceeded the threshold
        Returns:
        True if amount of time exceeds the threshold or this is a first event