mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2025-11-11 01:10:06 +05:30
Merge branch 'masonr:master' into master
This commit is contained in:
commit
f05839cad7
7 changed files with 48 additions and 39 deletions
|
|
@ -6,10 +6,10 @@ This directory contains all of the binaries required to run the benchmarking tes
|
||||||
|
|
||||||
| Binary Name | Version | Compile Date | Architecture | OS |
|
| Binary Name | Version | Compile Date | Architecture | OS |
|
||||||
|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|
|
||||||
| fio_x64 | 3.33 | 23-NOV-2022 | x86_64 | 64-bit |
|
| fio_x64 | 3.34 | 24-MAR-2023 | x86_64 | 64-bit |
|
||||||
| fio_x86 | 3.30* | 19-AUG-2022 | x86 | 32-bit |
|
| fio_x86 | 3.30* | 19-AUG-2022 | x86 | 32-bit |
|
||||||
| fio_aarch64 | 3.33 | 23-NOV-2022 | ARM | 64-bit |
|
| fio_aarch64 | 3.34 | 24-MAR-2023 | ARM | 64-bit |
|
||||||
| fio_arm | 3.30* | 19-AUG-2022 | ARM | 32-bit |
|
| fio_arm | 3.34 | 24-MAR-2023 | ARM | 32-bit |
|
||||||
| iperf_x64 | 3.13 | 26-FEB-2023 | x86_64 | 64-bit |
|
| iperf_x64 | 3.13 | 26-FEB-2023 | x86_64 | 64-bit |
|
||||||
| iperf_x86 | 3.13 | 26-FEB-2023 | x86 | 32-bit |
|
| iperf_x86 | 3.13 | 26-FEB-2023 | x86 | 32-bit |
|
||||||
| iperf_aarch64 | 3.13 | 26-FEB-2023 | ARM | 64-bit |
|
| iperf_aarch64 | 3.13 | 26-FEB-2023 | ARM | 64-bit |
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ source /hbb_exe/activate
|
||||||
|
|
||||||
# download and compile fio
|
# download and compile fio
|
||||||
cd ~
|
cd ~
|
||||||
curl -L https://github.com/axboe/fio/archive/fio-3.33.tar.gz -o "fio.tar.gz"
|
curl -L https://github.com/axboe/fio/archive/fio-3.34.tar.gz -o "fio.tar.gz"
|
||||||
tar xf fio.tar.gz
|
tar xf fio.tar.gz
|
||||||
cd fio-fio*
|
cd fio-fio*
|
||||||
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-native --build-static
|
CC=/root/${CROSS}-cross/bin/${CROSS}-gcc ./configure --disable-native --build-static
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ source /hbb_exe/activate
|
||||||
|
|
||||||
# download and compile fio
|
# download and compile fio
|
||||||
cd ~
|
cd ~
|
||||||
curl -L https://github.com/axboe/fio/archive/fio-3.33.tar.gz -o "fio.tar.gz"
|
curl -L https://github.com/axboe/fio/archive/fio-3.34.tar.gz -o "fio.tar.gz"
|
||||||
tar xf fio.tar.gz
|
tar xf fio.tar.gz
|
||||||
cd fio-fio*
|
cd fio-fio*
|
||||||
./configure --disable-native
|
./configure --disable-native
|
||||||
|
|
|
||||||
Binary file not shown.
BIN
bin/fio/fio_arm
BIN
bin/fio/fio_arm
Binary file not shown.
BIN
bin/fio/fio_x64
BIN
bin/fio/fio_x64
Binary file not shown.
77
yabs.sh
77
yabs.sh
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Yet Another Bench Script by Mason Rowe
|
# Yet Another Bench Script by Mason Rowe
|
||||||
# Initial Oct 2019; Last update Feb 2023
|
# Initial Oct 2019; Last update Mar 2023
|
||||||
|
|
||||||
# Disclaimer: This project is a work in progress. Any errors or suggestions should be
|
# Disclaimer: This project is a work in progress. Any errors or suggestions should be
|
||||||
# relayed to me via the GitHub project page linked below.
|
# relayed to me via the GitHub project page linked below.
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
# performance via fio. The script is designed to not require any dependencies
|
# performance via fio. The script is designed to not require any dependencies
|
||||||
# - either compiled or installed - nor admin privileges to run.
|
# - either compiled or installed - nor admin privileges to run.
|
||||||
|
|
||||||
YABS_VERSION="v2023-02-27"
|
YABS_VERSION="v2023-03-24"
|
||||||
|
|
||||||
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
|
||||||
echo -e '# Yet-Another-Bench-Script #'
|
echo -e '# Yet-Another-Bench-Script #'
|
||||||
|
|
@ -26,7 +26,7 @@ TIME_START=$(date '+%Y%m%d-%H%M%S')
|
||||||
YABS_START_TIME=$(date +%s)
|
YABS_START_TIME=$(date +%s)
|
||||||
|
|
||||||
# override locale to eliminate parsing errors (i.e. using commas as delimiters rather than periods)
|
# override locale to eliminate parsing errors (i.e. using commas as delimiters rather than periods)
|
||||||
if locale -a | grep ^C$ > /dev/null ; then
|
if locale -a 2>/dev/null | grep ^C$ > /dev/null; then
|
||||||
# locale "C" installed
|
# locale "C" installed
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
else
|
else
|
||||||
|
|
@ -250,9 +250,17 @@ DISTRO=$(grep 'PRETTY_NAME' /etc/os-release | cut -d '"' -f 2 )
|
||||||
echo -e "Distro : $DISTRO"
|
echo -e "Distro : $DISTRO"
|
||||||
KERNEL=$(uname -r)
|
KERNEL=$(uname -r)
|
||||||
echo -e "Kernel : $KERNEL"
|
echo -e "Kernel : $KERNEL"
|
||||||
VIRT=$(systemd-detect-virt)
|
VIRT=$(systemd-detect-virt 2>/dev/null)
|
||||||
VIRT=${VIRT^^} || VIRT="UNKNOWN"
|
VIRT=${VIRT^^} || VIRT="UNKNOWN"
|
||||||
echo -e "VM Type : $VIRT"
|
echo -e "VM Type : $VIRT"
|
||||||
|
if [[ ! -z $IPV4_CHECK && ! -z $IPV6_CHECK ]]; then
|
||||||
|
ONLINE="IPv4 & IPv6"
|
||||||
|
elif [[ ! -z $IPV4_CHECK ]]; then
|
||||||
|
ONLINE="IPv4"
|
||||||
|
elif [[ ! -z $IPV6_CHECK ]]; then
|
||||||
|
ONLINE="IPv6"
|
||||||
|
fi
|
||||||
|
echo -e "Net Online : $ONLINE"
|
||||||
|
|
||||||
# Function to get information from IP Address using ip-api.com free API
|
# Function to get information from IP Address using ip-api.com free API
|
||||||
function ip_info() {
|
function ip_info() {
|
||||||
|
|
@ -265,33 +273,36 @@ function ip_info() {
|
||||||
|
|
||||||
local response=$($DL_CMD http://ip-api.com/json/$net_ip)
|
local response=$($DL_CMD http://ip-api.com/json/$net_ip)
|
||||||
|
|
||||||
local country=$(echo "$response" | grep -Po '"country": *\K"[^"]*"')
|
# if no response, skip output
|
||||||
local country=${country//\"}
|
if [[ -z $response ]]; then
|
||||||
|
return
|
||||||
local region=$(echo "$response" | grep -Po '"regionName": *\K"[^"]*"')
|
|
||||||
local region=${region//\"}
|
|
||||||
|
|
||||||
local region_code=$(echo "$response" | grep -Po '"region": *\K"[^"]*"')
|
|
||||||
local region_code=${region_code//\"}
|
|
||||||
|
|
||||||
local city=$(echo "$response" | grep -Po '"city": *\K"[^"]*"')
|
|
||||||
local city=${city//\"}
|
|
||||||
|
|
||||||
local isp=$(echo "$response" | grep -Po '"isp": *\K"[^"]*"')
|
|
||||||
local isp=${isp//\"}
|
|
||||||
|
|
||||||
local org=$(echo "$response" | grep -Po '"org": *\K"[^"]*"')
|
|
||||||
local org=${org//\"}
|
|
||||||
|
|
||||||
local as=$(echo "$response" | grep -Po '"as": *\K"[^"]*"')
|
|
||||||
local as=${as//\"}
|
|
||||||
|
|
||||||
if [[ -n "$net_type" ]]; then
|
|
||||||
echo "Protocol : $net_type"
|
|
||||||
fi
|
|
||||||
if [[ -z "$net_type" ]]; then
|
|
||||||
echo "Protocol : Unknown"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local country=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^country/ {print $2}' | head -1)
|
||||||
|
country=${country//\"}
|
||||||
|
|
||||||
|
local region=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^regionName/ {print $2}')
|
||||||
|
region=${region//\"}
|
||||||
|
|
||||||
|
local region_code=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^region/ {print $2}' | head -1)
|
||||||
|
region_code=${region_code//\"}
|
||||||
|
|
||||||
|
local city=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^city/ {print $2}')
|
||||||
|
city=${city//\"}
|
||||||
|
|
||||||
|
local isp=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^isp/ {print $2}')
|
||||||
|
isp=${isp//\"}
|
||||||
|
|
||||||
|
local org=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^org/ {print $2}')
|
||||||
|
org=${org//\"}
|
||||||
|
|
||||||
|
local as=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^as/ {print $2}')
|
||||||
|
as=${as//\"}
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "$net_type Network Information:"
|
||||||
|
echo "---------------------------------"
|
||||||
|
|
||||||
if [[ -n "$isp" && -n "$as" ]]; then
|
if [[ -n "$isp" && -n "$as" ]]; then
|
||||||
echo "ISP : $isp"
|
echo "ISP : $isp"
|
||||||
echo "ASN : $as"
|
echo "ASN : $as"
|
||||||
|
|
@ -308,9 +319,6 @@ function ip_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z $SKIP_NET ]; then
|
if [ -z $SKIP_NET ]; then
|
||||||
echo -e
|
|
||||||
echo -e "Basic Network Information:"
|
|
||||||
echo -e "---------------------------------"
|
|
||||||
ip_info
|
ip_info
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -722,7 +730,8 @@ function iperf_test {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run a latency test via ping -c1 command -> will return "xx.x ms"
|
# Run a latency test via ping -c1 command -> will return "xx.x ms"
|
||||||
[[ ! -z $LOCAL_PING ]] && LATENCY_RUN="$(ping -c1 $URL | grep -Po 'time=.*' | sed s/'time='//)" || LATENCY_RUN="--"
|
[[ ! -z $LOCAL_PING ]] && LATENCY_RUN="$(ping -c1 $URL 2>/dev/null | grep -o 'time=.*' | sed s/'time='//)"
|
||||||
|
[[ -z $LATENCY_RUN ]] && LATENCY_RUN="--"
|
||||||
|
|
||||||
# parse the resulting send and receive speed results
|
# parse the resulting send and receive speed results
|
||||||
IPERF_SENDRESULT="$(echo "${IPERF_RUN_SEND}" | grep SUM | grep receiver)"
|
IPERF_SENDRESULT="$(echo "${IPERF_RUN_SEND}" | grep SUM | grep receiver)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue