MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_alerts

Method get_alerts

traffic_analyzer.py:1650–1660  ·  view source on GitHub ↗

Get recent alerts

(self, limit: int = 100, level: str = None)

Source from the content-addressed store, hash-verified

1648
1649 # Mark this alert as seen with expiry
1650 self._alert_hashes.add(alert_hash)
1651 self._alert_hash_expiry[alert_hash] = current_time + self._alert_dedup_window
1652
1653 # Clean up old hash entries periodically
1654 if len(self._alert_hash_expiry) > 1000:
1655 expired = [h for h, exp in self._alert_hash_expiry.items() if exp < current_time]
1656 for h in expired:
1657 self._alert_hashes.discard(h)
1658 del self._alert_hash_expiry[h]
1659
1660 self._alert_counter += 1
1661 alert = TrafficAlert(
1662 alert_id=f"TA-{self._alert_counter:06d}",
1663 level=level,

Callers 1

get_traffic_alertsFunction · 0.80

Calls 2

TrafficAlertLevelClass · 0.85
to_dictMethod · 0.45

Tested by

no test coverage detected