Class AlertRateLimiter

java.lang.Object
com.github.catomat0.aoploghelper.alert.AlertRateLimiter

public class AlertRateLimiter extends Object
Trivial per-minute counter used to keep the webhook from spamming when the app is emitting a burst of errors (e.g. during a downstream outage).

perMinute <= 0 disables the limit.

  • Constructor Details

    • AlertRateLimiter

      public AlertRateLimiter(int limitPerMinute)
  • Method Details

    • tryAcquire

      public boolean tryAcquire()