From ecf1b620d37741ed18418a0299a715291d6c3a9d Mon Sep 17 00:00:00 2001 From: FreeCarbene <1718658837@qq.com> Date: Thu, 7 Sep 2023 23:40:51 +0800 Subject: [PATCH] [benchmark] format tests scripts' comment The indentation format of the comment is incorrect. Signed-off-by: FreeCarbene <1718658837@qq.com> --- .../benchmark/scripts/boot-parallel-kata-time.sh | 14 +++++++------- .../scripts/boot-parallel-kuasar-time.sh | 16 ++++++++-------- tests/benchmark/scripts/boot-serial-kata-time.sh | 16 ++++++++-------- .../benchmark/scripts/boot-serial-kuasar-time.sh | 16 ++++++++-------- tests/benchmark/scripts/kata-mem-test.sh | 10 +++++----- tests/benchmark/scripts/kuasar-mem-test.sh | 10 +++++----- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/tests/benchmark/scripts/boot-parallel-kata-time.sh b/tests/benchmark/scripts/boot-parallel-kata-time.sh index 53fec0ab..aacc314b 100644 --- a/tests/benchmark/scripts/boot-parallel-kata-time.sh +++ b/tests/benchmark/scripts/boot-parallel-kata-time.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#PARALLEL is the number of container +# PARALLEL is the number of container PARALLEL=50 workdir=$(dirname "$(pwd)") RAW=${workdir}/data/raw @@ -39,11 +39,11 @@ function getTiming(){ once_test(){ -#Kill all pods to prevent interference with testing +# Kill all pods to prevent interference with testing crictl rm -f -a crictl rmp -f -a -#Create $PARALLEL container.json and pod.json +# Create $PARALLEL container.json and pod.json for((i=0;i<$PARALLEL;i++)) do cat > $workdir/json/container/container_$i.json << EOF @@ -91,7 +91,7 @@ EOF EOF done -#Start timing +# Start timing start_time=$(date +%s.%N) for((i=0;i<$PARALLEL;i++)) @@ -101,7 +101,7 @@ done end_time=$(date +%s.%N) -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $PARALLEL ]; do @@ -112,13 +112,13 @@ break fi done -#End timing +# End timing boot_time=$(getTiming $start_time $end_time) if [ ${boot_time} -lt 6000 ]; then echo "BootTime: ${boot_time}ms" -#Output to the corresponding file +# Output to the corresponding file echo "${boot_time}" >> ${TIME_DAT} fi diff --git a/tests/benchmark/scripts/boot-parallel-kuasar-time.sh b/tests/benchmark/scripts/boot-parallel-kuasar-time.sh index 60576eec..79ace5c7 100644 --- a/tests/benchmark/scripts/boot-parallel-kuasar-time.sh +++ b/tests/benchmark/scripts/boot-parallel-kuasar-time.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#PARALLEL is the number of container +# PARALLEL is the number of container PARALLEL=50 workdir=$(dirname "$(pwd)") RAW=${workdir}/data/raw @@ -21,7 +21,7 @@ TIME_DAT=${RAW}/boot-parallel-${PARALLEL}-kuasar-time.dat mkdir -p $workdir/json/container mkdir -p $workdir/json/pod -#Function to get the interval time(ms) +# Function to get the interval time(ms) function getTiming(){ start=$1 end=$2 @@ -39,11 +39,11 @@ function getTiming(){ once_test(){ -#Kill all pods to prevent interference with testing +# Kill all pods to prevent interference with testing crictl rm -f -a crictl rmp -f -a -#Create $PARALLEL container.json and pod.json +# Create $PARALLEL container.json and pod.json for((i=0;i<$PARALLEL;i++)) do cat > $workdir/json/container/container_$i.json << EOF @@ -95,7 +95,7 @@ EOF EOF done -#Start timing +# Start timing start_time=$(date +%s.%N) for((i=0;i<$PARALLEL;i++)) @@ -105,7 +105,7 @@ done end_time=$(date +%s.%N) -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $PARALLEL ]; do @@ -116,13 +116,13 @@ break fi done -#End timing +# End timing boot_time=$(getTiming $start_time $end_time) if [ ${boot_time} -lt 20000 ]; then echo "BootTime: ${boot_time}ms" -#Output to the corresponding file +# Output to the corresponding file echo "${boot_time}" >> ${TIME_DAT} fi diff --git a/tests/benchmark/scripts/boot-serial-kata-time.sh b/tests/benchmark/scripts/boot-serial-kata-time.sh index 5f421c99..247d6ee8 100644 --- a/tests/benchmark/scripts/boot-serial-kata-time.sh +++ b/tests/benchmark/scripts/boot-serial-kata-time.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#num is the number of container +# $num is the number of container num=100 workdir=$(dirname "$(pwd)") RAW=${workdir}/data/raw @@ -21,7 +21,7 @@ TIME_DAT=${RAW}/boot-serial-500-kata-time.dat mkdir -p $workdir/json/container mkdir -p $workdir/json/pod -#Function to get the interval time(ms) +# Function to get the interval time(ms) function getTiming(){ start=$1 end=$2 @@ -40,7 +40,7 @@ function getTiming(){ once_test(){ i=$1 -#Create $PARALLEL container.json and pod.json +# Create $PARALLEL container.json and pod.json cat > $workdir/json/container/container_$i.json << EOF { "metadata": { @@ -86,30 +86,30 @@ EOF EOF -#Start timing +# Start timing start_time=$(date +%s.%N) crictl run -r kata --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $(($i+1)) ]; do a=`crictl ps | grep testcontainer | wc -l` done -#End timing +# End timing end_time=$(date +%s.%N) boot_time=$(getTiming $start_time $end_time) echo "BootTime: ${boot_time}ms" -#Output to the corresponding file +# Output to the corresponding file echo "${boot_time}" >> ${TIME_DAT} } -#Kill all pods to prevent interference with testing +# Kill all pods to prevent interference with testing crictl rm -f -a crictl rmp -f -a diff --git a/tests/benchmark/scripts/boot-serial-kuasar-time.sh b/tests/benchmark/scripts/boot-serial-kuasar-time.sh index 9e1fdbe5..9770eeaf 100644 --- a/tests/benchmark/scripts/boot-serial-kuasar-time.sh +++ b/tests/benchmark/scripts/boot-serial-kuasar-time.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#num is the number of container +# $num is the number of container num=50 workdir=$(dirname "$(pwd)") RAW=${workdir}/data/raw @@ -21,7 +21,7 @@ TIME_DAT=${RAW}/boot-serial-1000-kuasar-time.dat mkdir -p $workdir/json/container mkdir -p $workdir/json/pod -#Function to get the interval time(ms) +# Function to get the interval time(ms) function getTiming(){ start=$1 end=$2 @@ -40,7 +40,7 @@ function getTiming(){ once_test(){ i=$1 -#Create $PARALLEL container.json and pod.json +# Create $PARALLEL container.json and pod.json cat > $workdir/json/container/container_$i.json << EOF { "metadata": { @@ -90,30 +90,30 @@ EOF EOF -#Start timing +# Start timing start_time=$(date +%s.%N) crictl run -r kuasar --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $(($i+1)) ]; do a=`crictl ps | grep testcontainer | wc -l` done -#End timing +# End timing end_time=$(date +%s.%N) boot_time=$(getTiming $start_time $end_time) echo "BootTime: ${boot_time}ms" -#Output to the corresponding file +# Output to the corresponding file echo "${boot_time}" >> ${TIME_DAT} } -#Kill all pods to prevent interference with testing +# Kill all pods to prevent interference with testing crictl rm -f -a crictl rmp -f -a diff --git a/tests/benchmark/scripts/kata-mem-test.sh b/tests/benchmark/scripts/kata-mem-test.sh index 6aa28a01..107980dc 100644 --- a/tests/benchmark/scripts/kata-mem-test.sh +++ b/tests/benchmark/scripts/kata-mem-test.sh @@ -13,13 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -#$num is the number of pod +# $num is the number of pod num=50 workdir=$(dirname $(cd $(dirname $0); pwd)) mkdir -p $workdir/json/container mkdir -p $workdir/json/pod -#Kill all pods to prevent interference with testing +# Kill all pods to prevent interference with testing crictl rm -f -a crictl rmp -f -a rm -f mem @@ -76,17 +76,17 @@ do crictl run -r kata --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json & done -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $(($num+1)) ]; do a=`crictl ps | grep testcontainer | wc -l` done -#get pids of all containers +# Get pids of all containers pids=$(ps -ef | grep -v grep | grep -i containerd-shim-kata-v2 | awk '{print$2}') -#get Pss of each container +# Get Pss of each container for i in ${pids} do cat /proc/$i/smaps_rollup | grep "Pss" >> mem diff --git a/tests/benchmark/scripts/kuasar-mem-test.sh b/tests/benchmark/scripts/kuasar-mem-test.sh index 88472bf5..b67e2ea5 100644 --- a/tests/benchmark/scripts/kuasar-mem-test.sh +++ b/tests/benchmark/scripts/kuasar-mem-test.sh @@ -13,13 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -#$num is the number of pod +# $num is the number of pod num=50 workdir=$(dirname $(cd $(dirname $0); pwd)) mkdir -p $workdir/json/container mkdir -p $workdir/json/pod -#remove to prevent interference with testing +# Remove to prevent interference with testing crictl rm -f -a crictl rmp -f -a rm -f mem @@ -81,17 +81,17 @@ do crictl run -r kuasar --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json & done -#Wait for all the containers to finish starting +# Wait for all the containers to finish starting a=`crictl ps | grep testcontainer | wc -l` while [ $a -ne $(($num+1)) ]; do a=`crictl ps | grep testcontainer | wc -l` done -#get pid of vmm-sandboxer +# Get pid of vmm-sandboxer pid=$(ps -ef | grep -v grep | grep vmm-sandboxer | awk '{print$2}') -#get Pss of vmm-sandboxer +# Get Pss of vmm-sandboxer cat /proc/$pid/smaps_rollup | grep "Pss" >> mem pss_array=$(cat mem | grep -w Pss | awk '{print$2}')