diff --git a/enrichment/indexed_capture.py b/enrichment/indexed_capture.py index 6564895..0445d68 100644 --- a/enrichment/indexed_capture.py +++ b/enrichment/indexed_capture.py @@ -290,9 +290,23 @@ class IndexedCapture: def _cisco_avg_clients(self, ssid, start_ts, end_ts): if ssid not in self.cisco_ssid_clients: + print(f"[DEBUG] No Cisco client data for SSID {ssid}") return 0 - windowed = [count for ts, count in self.cisco_ssid_clients[ssid] if start_ts <= ts <= end_ts] - return round(mean(windowed), 2) if windowed else 0 + + # DEBUG: print window details + print(f"[DEBUG] Querying Cisco clients for SSID={ssid} between start_ts={start_ts} and end_ts={end_ts}") + + hits = [] + for ts, count in self.cisco_ssid_clients[ssid]: + print(f"[DEBUG] Cisco record ts={ts}, count={count}") + if start_ts <= ts <= end_ts: + print(f"[DEBUG] --> Included in window!") + hits.append(count) + + if not hits: + print(f"[DEBUG] No Cisco client counts matched window for SSID={ssid}") + + return round(mean(hits), 2) if hits else 0 def _cisco_max_clients(self, ssid, start_ts, end_ts): if ssid not in self.cisco_ssid_clients: