From a1aefedafffd633fedae07d0b60b4b3ca6ae1333 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Tue, 29 Apr 2025 11:20:36 -0500 Subject: [PATCH] Add debug print statements to query_metrics for improved packet tracking --- enrichment/indexed_capture.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/enrichment/indexed_capture.py b/enrichment/indexed_capture.py index 9a6047a..41025d9 100644 --- a/enrichment/indexed_capture.py +++ b/enrichment/indexed_capture.py @@ -138,7 +138,6 @@ class IndexedCapture: def query_metrics(self, start_ts, end_ts, ap_bssid, ap_channel): packets = self.get_packets_in_time_range(start_ts, end_ts) - print(f"[DEBUG] Packets in window: {len(packets)} between {start_ts} and {end_ts}") # Build local windowed structures window_clients = defaultdict(set) @@ -163,18 +162,22 @@ class IndexedCapture: else: continue - print(f"[DEBUG] Packet ts={packet.frame_info.time_epoch}, freq={freq}, resolved_channel={channel}, ap_channel={ap_channel}") - # Track APs (beacons / probe responses only!) subtype = int(getattr(wlan, 'type_subtype', '0'), 16) if subtype in (5, 8) and bssid: window_aps[channel].add(bssid) + if channel == ap_channel: + print(f"[DEBUG] Adding bssid={bssid} to window_aps[{channel}]") + # Track clients for mac in (sa, da): if mac and mac != 'ff:ff:ff:ff:ff:ff': window_clients[channel].add(mac) + if channel == ap_channel: + print(f"[DEBUG] Adding mac={mac} to window_clients[{channel}]") + # Track signals signal = getattr(radio, 'dbm_antsignal', None) if signal: