Collect and store start and end timestamps.
This commit is contained in:
parent
36d2c6641b
commit
05e4d6bf6c
1 changed files with 6 additions and 2 deletions
|
@ -43,13 +43,15 @@ FAILED_START=$(get_tx_failed)
|
||||||
|
|
||||||
# Create CSV header if needed
|
# Create CSV header if needed
|
||||||
if [ ! -f "$TEST_FILE" ]; then
|
if [ ! -f "$TEST_FILE" ]; then
|
||||||
echo "Link,Level,Noise,BSSID,TX Bitrate,RX Bitrate,$(speedtest --csv-header),TX Failures,Channel,Frequency,Packet Loss,Jitter" > "$TEST_FILE"
|
echo "StartTimestamp,EndTimestamp,Link,Level,Noise,BSSID,TX Bitrate,RX Bitrate,$(speedtest --csv-header),TX Failures,Channel,Frequency,Packet Loss,Jitter" > "$TEST_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
||||||
COUNTER=$((COUNTER + 1))
|
COUNTER=$((COUNTER + 1))
|
||||||
echo "Executing test $COUNTER of $NUM_TESTS..."
|
echo "Executing test $COUNTER of $NUM_TESTS..."
|
||||||
|
|
||||||
|
START_TIME=$(date -Iseconds)
|
||||||
|
|
||||||
for ((i=1; i<=NUM_SAMPLES; i++)); do
|
for ((i=1; i<=NUM_SAMPLES; i++)); do
|
||||||
echo " Gathering sample $i of $NUM_SAMPLES..."
|
echo " Gathering sample $i of $NUM_SAMPLES..."
|
||||||
|
|
||||||
|
@ -71,8 +73,10 @@ while [ "$COUNTER" -lt "$NUM_TESTS" ]; do
|
||||||
packet_loss=$(ping -c $PING_COUNT -q $PING_TARGET | grep -oP '\d+(?=% packet loss)')
|
packet_loss=$(ping -c $PING_COUNT -q $PING_TARGET | grep -oP '\d+(?=% packet loss)')
|
||||||
jitter=$(ping -c $PING_COUNT $PING_TARGET | grep "time=" | awk '{print $(NF-1)}' | sed 's/time=//g' | awk '{sum+=$1; sumsq+=$1*$1} END {if (NR>1) print sqrt(sumsq/NR - (sum/NR)**2); else print 0}')
|
jitter=$(ping -c $PING_COUNT $PING_TARGET | grep "time=" | awk '{print $(NF-1)}' | sed 's/time=//g' | awk '{sum+=$1; sumsq+=$1*$1} END {if (NR>1) print sqrt(sumsq/NR - (sum/NR)**2); else print 0}')
|
||||||
|
|
||||||
|
END_TIME=$(date -Iseconds)
|
||||||
|
|
||||||
# Log everything
|
# Log everything
|
||||||
echo "$link_level_noise,$bssid_and_bitrate,$speed_results,$FAILED_DELTA,$channel,$freq,$packet_loss,$jitter" >> "$TEST_FILE"
|
echo "$START_TIME,$END_TIME,$link_level_noise,$bssid_and_bitrate,$speed_results,$FAILED_DELTA,$channel,$freq,$packet_loss,$jitter" >> "$TEST_FILE"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$COUNTER" -lt "$NUM_TESTS" ]; then
|
if [ "$COUNTER" -lt "$NUM_TESTS" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue