Refactor get_tx_failed function to remove unnecessary logging and improve performance

This commit is contained in:
Yaro Kasear 2025-04-23 12:41:21 -05:00
parent 5abb99ab86
commit 0818da0351

View file

@ -36,10 +36,7 @@ sleep $LEAD_TIME
# Function to get current TX failed count
get_tx_failed() {
echo "Getting TX failed count..."
SECONDS=0
iw dev $INTERFACE station dump | awk '/tx failed/ {print $3}'
echo "This took $SECONDS seconds."
}
freq_to_channel() {
@ -162,9 +159,12 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do
continue
fi
SECONDS=0
echo " Gathering TX failed count..."
FAILED_NOW=$(get_tx_failed)
FAILED_DELTA=$((FAILED_NOW - FAILED_START))
FAILED_START=$FAILED_NOW
echo " This took $SECONDS seconds."
freq=$(iw dev "$INTERFACE" link | awk '/freq:/ {print $2}')
channel=$(freq_to_channel "$freq")