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

Function get_traffic_analyzer

traffic_analyzer.py:1711–1716  ·  view source on GitHub ↗

Get or create the global TrafficAnalyzer instance

(shared_data=None, interface: str = None)

Source from the content-addressed store, hash-verified

1709 """Count alerts grouped by severity level"""
1710 counts = {level.value: 0 for level in TrafficAlertLevel}
1711 for alert in self.alerts:
1712 counts[alert.level.value] += 1
1713 return counts
1714
1715 def _count_alerts_by_category(self) -> Dict[str, int]:
1716 """Count alerts grouped by category"""
1717 counts = defaultdict(int)
1718 for alert in self.alerts:
1719 counts[alert.category] += 1

Callers

nothing calls this directly

Calls 1

TrafficAnalyzerClass · 0.85

Tested by

no test coverage detected