mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Update comments
Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
27c9531155
commit
d217b0e77b
15
bench.sh
15
bench.sh
@ -64,14 +64,14 @@ next() {
|
|||||||
|
|
||||||
speed_test() {
|
speed_test() {
|
||||||
local nodeName="$2"
|
local nodeName="$2"
|
||||||
[ -z "$1" ] && ./speedtest-cli/speedtest --progress=no --accept-license > speedtest-cli/speedtest.log 2>&1 || \
|
[ -z "$1" ] && ./speedtest-cli/speedtest --progress=no --accept-license --accept-gdpr > ./speedtest-cli/speedtest.log 2>&1 || \
|
||||||
./speedtest-cli/speedtest --progress=no -s "$1" --accept-license > speedtest-cli/speedtest.log 2>&1
|
./speedtest-cli/speedtest --progress=no --server-id=$1 --accept-license --accept-gdpr > ./speedtest-cli/speedtest.log 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
local dl_speed=$(awk '/Download/{print $3}' speedtest-cli/speedtest.log)
|
local dl_speed=$(awk '/Download/{print $3" "$4}' ./speedtest-cli/speedtest.log)
|
||||||
local up_speed=$(awk '/Upload/{print $3}' speedtest-cli/speedtest.log)
|
local up_speed=$(awk '/Upload/{print $3" "$4}' ./speedtest-cli/speedtest.log)
|
||||||
local latency=$(awk '/Latency/{print $2}' speedtest-cli/speedtest.log)
|
local latency=$(awk '/Latency/{print $2" "$3}' ./speedtest-cli/speedtest.log)
|
||||||
if [[ -n "${dl_speed}" && -n "${up_speed}" && -n "${latency}" ]]; then
|
if [[ -n "${dl_speed}" && -n "${up_speed}" && -n "${latency}" ]]; then
|
||||||
printf "\033[0;33m%-18s\033[0;32m%-18s\033[0;31m%-20s\033[0;36m%-12s\033[0m\n" " ${nodeName}" "${up_speed} Mbit/s" "${dl_speed} Mbit/s" "${latency} ms"
|
printf "\033[0;33m%-18s\033[0;32m%-18s\033[0;31m%-20s\033[0;36m%-12s\033[0m\n" " ${nodeName}" "${up_speed}" "${dl_speed}" "${latency}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -236,7 +236,6 @@ ioall=$( awk 'BEGIN{print '$ioraw1' + '$ioraw2' + '$ioraw3'}' )
|
|||||||
ioavg=$( awk 'BEGIN{printf "%.1f", '$ioall' / 3}' )
|
ioavg=$( awk 'BEGIN{printf "%.1f", '$ioall' / 3}' )
|
||||||
echo -e " Average I/O speed : $(_yellow "$ioavg MB/s")"
|
echo -e " Average I/O speed : $(_yellow "$ioavg MB/s")"
|
||||||
next
|
next
|
||||||
install_speedtest
|
install_speedtest && printf "%-18s%-18s%-20s%-12s\n" " Node Name" "Upload Speed" "Download Speed" "Latency"
|
||||||
printf "%-18s%-18s%-20s%-12s\n" " Node Name" "Upload Speed" "Download Speed" "Latency"
|
|
||||||
speed && rm -fr speedtest-cli
|
speed && rm -fr speedtest-cli
|
||||||
next
|
next
|
||||||
|
Loading…
x
Reference in New Issue
Block a user