MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / anomaly_detection

Function anomaly_detection

nodedb/src/control/security/observability.rs:315–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313
314 #[test]
315 fn anomaly_detection() {
316 let m = AuthMetrics::new();
317 for _ in 0..50 {
318 m.record_auth_failure("password");
319 }
320 assert!(m.failed_login_spike(10));
321 assert!(!m.failed_login_spike(100));
322 }
323
324 #[test]
325 fn circuit_breaker() {

Callers

nothing calls this directly

Calls 1

record_auth_failureMethod · 0.45

Tested by

no test coverage detected