Skip to content

Commit

Permalink
Merge pull request #482 from tiiuae/feature/field_test_log_update_exp…
Browse files Browse the repository at this point in the history
…_tput

field test log update with exp tput and inactive time
  • Loading branch information
saauvine authored Oct 14, 2024
2 parents 83dfa27 + 426b7a8 commit cf0fec9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions common/tools/field_test_logger/field_test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def timestamp() -> str:
ftl.register_logger_function("Halow SNR", wifi_stats.get_snr)
ftl.register_logger_function("RX MCS [MAC,MCS;MAC,MCS ...]", wifi_stats.get_rx_mcs)
ftl.register_logger_function("TX MCS [MAC,MCS;MAC,MCS ...]", wifi_stats.get_tx_mcs)
ftl.register_logger_function("Exp. throughput(Mbps) [MAC,Exp.Tput ...]", wifi_stats.get_expected_throughput)
ftl.register_logger_function("inactive time (ms) [MAC,inactive time ...]", wifi_stats.get_inactive_time)
ftl.register_logger_function("RX throughput [Bits/s]", wifi_stats.get_rx_throughput)
ftl.register_logger_function("TX throughput [Bits/s]", wifi_stats.get_tx_throughput)
ftl.register_logger_function("Neighbors", wifi_stats.get_neighbors)
Expand Down
39 changes: 38 additions & 1 deletion common/tools/field_test_logger/wifi_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ def get_tx_mcs(self):

return out

def get_expected_throughput(self):
out = ""
for i in self.__stations.keys():
# Expected throughput is at index 3
out = f"{out}{i},{self.__stations[i][3]};"

# Remove semicolon after the last station
return out[:-1]

def get_inactive_time(self):
out = ""
for i in self.__stations.keys():
# Inactive Time is at index 4
out = f"{out}{i},{self.__stations[i][4]};"

# Remove semicolon after the last station
return out[:-1]

def get_txpower(self):
return self.__txpower

Expand Down Expand Up @@ -150,6 +168,8 @@ def __update_mcs_and_rssi(self):
tx_mcs = "NaN"
rx_mcs = "NaN"
rssi = "NaN"
expected_throughput = "NaN"
inactive_time = "NaN"

# halow station info fetched from cli_app if needed.
halow_stations = None
Expand Down Expand Up @@ -189,7 +209,24 @@ def __update_mcs_and_rssi(self):
rx_mcs = halow_stations.get(station_mac)[1]
except (IndexError, TypeError):
pass
self.__stations[station_mac] = [rssi, tx_mcs, rx_mcs]

if "expected throughput:" in line:
# Extract the value and remove the "Mbps" suffix
throughput_str = line.split("expected throughput:")[1].strip().replace("Mbps", "").strip()
try:
expected_throughput = float(throughput_str)
except ValueError:
pass

if "inactive time:" in line:
# Extract the value and remove the "ms" suffix
inactive_time_str = line.split("inactive time:")[1].strip().replace("ms", "").strip()
try:
inactive_time = int(inactive_time_str)
except ValueError:
pass

self.__stations[station_mac] = [rssi, tx_mcs, rx_mcs, expected_throughput, inactive_time]

def get_halow_stations(self) -> dict:
cli_app_cmd = ['/usr/local/bin/cli_app', 'show', 'sta', '0', 'all']
Expand Down

0 comments on commit cf0fec9

Please sign in to comment.