Refactor debug output in Cisco client tracking for improved clarity and consistency
This commit is contained in:
parent
d9e8a8eac9
commit
5e11cfcc80
1 changed files with 4 additions and 5 deletions
|
@ -102,7 +102,6 @@ class IndexedCapture:
|
||||||
if ssid:
|
if ssid:
|
||||||
self.cisco_ssid_clients[ssid].append((timestamp, num_clients))
|
self.cisco_ssid_clients[ssid].append((timestamp, num_clients))
|
||||||
self.cisco_reported_clients.append(num_clients)
|
self.cisco_reported_clients.append(num_clients)
|
||||||
print(f"[DEBUG] Indexed {len(self.cisco_reported_clients)} Cisco client reports.")
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -292,20 +291,20 @@ class IndexedCapture:
|
||||||
if ssid not in self.cisco_ssid_clients:
|
if ssid not in self.cisco_ssid_clients:
|
||||||
print(f"[DEBUG] No Cisco client data for SSID {ssid}")
|
print(f"[DEBUG] No Cisco client data for SSID {ssid}")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# DEBUG: print window details
|
# DEBUG: print window details
|
||||||
print(f"[DEBUG] Querying Cisco clients for SSID={ssid} between start_ts={start_ts} and end_ts={end_ts}")
|
print(f"[DEBUG] Querying Cisco clients for SSID={ssid} between start_ts={start_ts} and end_ts={end_ts}")
|
||||||
|
|
||||||
hits = []
|
hits = []
|
||||||
for ts, count in self.cisco_ssid_clients[ssid]:
|
for ts, count in self.cisco_ssid_clients[ssid]:
|
||||||
print(f"[DEBUG] Cisco record ts={ts}, count={count}")
|
print(f"[DEBUG] Cisco record ts={ts}, count={count}")
|
||||||
if start_ts <= ts <= end_ts:
|
if start_ts <= ts <= end_ts:
|
||||||
print(f"[DEBUG] --> Included in window!")
|
print(f"[DEBUG] --> Included in window!")
|
||||||
hits.append(count)
|
hits.append(count)
|
||||||
|
|
||||||
if not hits:
|
if not hits:
|
||||||
print(f"[DEBUG] No Cisco client counts matched window for SSID={ssid}")
|
print(f"[DEBUG] No Cisco client counts matched window for SSID={ssid}")
|
||||||
|
|
||||||
return round(mean(hits), 2) if hits else 0
|
return round(mean(hits), 2) if hits else 0
|
||||||
|
|
||||||
def _cisco_max_clients(self, ssid, start_ts, end_ts):
|
def _cisco_max_clients(self, ssid, start_ts, end_ts):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue