Class ConnectionLimitViolationDetectionService

java.lang.Object
energy.eddie.aiida.services.connectionlimit.ConnectionLimitViolationDetectionService

@Service @ConditionalOnProperty(prefix="aiida.connection-limit.violation-detection", name="enabled", matchIfMissing=true) public class ConnectionLimitViolationDetectionService extends Object
Periodically checks the latest measured data of assigned data sources against the effective connection limits of the permissions and persists the resulting violations. The users are notified when a violation starts and when it ends.

The check interval can be configured with aiida.connection-limit.violation-detection.interval-ms (default: 10 seconds). Detection can be disabled with aiida.connection-limit.violation-detection.enabled=false.

A violation only ends once the measured power stayed within the limits for the recovery hold (aiida.connection-limit.violation-detection.recovery-hold-ms, default: 1 minute), so that a value oscillating around a limit is a single violation and does not flood the user with notifications. The violation ends at the first record that was back within the limits. Only accepted permissions are monitored, the violations of other permissions end. A record without an effective limit counts as within the limits, as no limits means no violation. The hold is measured in record timestamps, so a violation stays open until a record confirms the recovery.