Code Review
/
iec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add time_connect to service latency test script
[iec.git]
/
src
/
tools
/
test_service_latency.sh
diff --git
a/src/tools/test_service_latency.sh
b/src/tools/test_service_latency.sh
index
2ef5655
..
2d200f5
100755
(executable)
--- a/
src/tools/test_service_latency.sh
+++ b/
src/tools/test_service_latency.sh
@@
-2,6
+2,7
@@
set -e
localIP=$(ip route show default | cut -d " " -f 9)
echo "localIP:"$localIP
localIP=$(ip route show default | cut -d " " -f 9)
echo "localIP:"$localIP
+echo ""
if [ "x${1}" == "x" ]; then
echo "No node IP defined, uses the local IP instead."
if [ "x${1}" == "x" ]; then
echo "No node IP defined, uses the local IP instead."
@@
-10,18
+11,12
@@
fi
nodeIP=$localIP
aNum=1000
nodeIP=$localIP
aNum=1000
-
display_help () {
echo "Usage:"
echo " "
echo "Please input the nodeIP and access number"
}
display_help () {
echo "Usage:"
echo " "
echo "Please input the nodeIP and access number"
}
-#svcIP=$(kubectl get svc | grep nginx |grep -i "nodeport" | awk -F'[ ]+' '{print $3}')
-#echo "Service IP:"$svcIP
-#nodePort=$(kubectl get svc | grep nginx |grep -i "nodeport" | awk -F'[ ]+' '{print $5}' | cut -d ":" -f 2 |cut -d "/" -f 1)
-#echo "NodePort:"$nodePort
-
ARGS=`getopt -a -o s:n:c:p:k::h:: -l nodeIP:,number:,serviceIP:,nodePort:,nodeOnly::,help:: -- "$@"`
eval set -- "${ARGS}"
ARGS=`getopt -a -o s:n:c:p:k::h:: -l nodeIP:,number:,serviceIP:,nodePort:,nodeOnly::,help:: -- "$@"`
eval set -- "${ARGS}"
@@
-82,24
+77,31
@@
if [ "x${nodePort}" == "x" ]; then
echo "NodePort:"$nodePort
fi
echo "NodePort:"$nodePort
fi
-
accessNum=$((aNum + 0))
accessNum=$((aNum + 0))
-#for i in {1..$(($aNum + 0))}
START=1
END=$aNum
START=1
END=$aNum
-
if [ "x${nodeOnly}" != "xtrue" ]; then
if [ "x${nodeOnly}" != "xtrue" ]; then
- echo "Now access the service IP $svcIP:80, $aNum times:"
+ echo "Now access the service IP $svcIP:80, $aNum times
, time total
:"
for (( c=$START; c<=$END; c++))
for (( c=$START; c<=$END; c++))
- do
+ do
curl -w "%{time_total}\n" -o /dev/null -s http://$svcIP
done | jq -s add/length
curl -w "%{time_total}\n" -o /dev/null -s http://$svcIP
done | jq -s add/length
+ echo "Now access the service IP $svcIP:80, $aNum times, time connect:"
+ for (( c=$START; c<=$END; c++))
+ do
+ curl -w "%{time_connect}\n" -o /dev/null -s http://$svcIP
+ done | jq -s add/length
fi
echo ""
fi
echo ""
-echo "Now access the $nodeIP:$nodePort, $aNum times"
+echo "Now access the $nodeIP:$nodePort, $aNum times
, time total:
"
for (( c=$START; c<=$END; c++))
do
curl -w "%{time_total}\n" -o /dev/null -s $nodeIP:$nodePort
done | jq -s add/length
for (( c=$START; c<=$END; c++))
do
curl -w "%{time_total}\n" -o /dev/null -s $nodeIP:$nodePort
done | jq -s add/length
+echo "Now access the $nodeIP:$nodePort, $aNum times, time total:"
+for (( c=$START; c<=$END; c++))
+do
+ curl -w "%{time_connect}\n" -o /dev/null -s $nodeIP:$nodePort
+done | jq -s add/length