diff --git a/performance_tests.sh b/performance_tests.sh index 1f100dc..408e533 100755 --- a/performance_tests.sh +++ b/performance_tests.sh @@ -2,7 +2,7 @@ . driglibash-base #prerequisite: creation_repo.sh has been run - +files_to_keep='sample0' Help() { echo " @@ -27,7 +27,7 @@ test0(){ bw0=$(grep -e "Receiving objects:" cloning_text| grep -o "[[:digit:].]* MiB " | tail -n1) echo "memory usage in a classic cloning : $mem0" echo "bandwidth usage : $bw0" - #run rm -rf performance_testing + run rm -rf performance_testing } test1(){ @@ -39,7 +39,7 @@ test1(){ echo "memory usage in a --single-branch cloning : $mem1" echo "bandwidth usage : $bw1" run - #rm -rf performance_testing + rm -rf performance_testing } test2(){ @@ -66,6 +66,26 @@ test3(){ rm -rf performance_testing } +test4(){ + section TEST4 + run echo 'TEST 4 : case of sparse-checking only some files with depth=1' + run mkdir performance_testing #to do : isoler le nom de l'URL + run cd performance_testing + run git init -q + run git config core.sparsecheckout true + run echo $files_to_keep >> .git/info/sparse-checkout + run git remote add -f origin $1 &> cloning_text #to do : find a way to do this quietly/why isn't it writing in cloning_text? + echo 'juste avant le pull' + run git pull --progress origin main 2> cloning_text #to do : adapter au cas où ce soit master et pas main + mem4=$(du . | tail -n1 | tr -cd [:digit:]) + bw4=$(grep -e "Receiving objects:" cloning_text| grep -o "[[:digit:].]* MiB " | tail -n1) + echo "memory usage in a --depth=1 with sparse checking only $files_to_keep : $mem4" + echo "bandwidth usage : $bw4" + cd .. + run rm -rf performance_testing +} +#est-ce que ça fait depth=1 ? + while getopts ":hn:a" option; do case $option in h) # display Help @@ -95,6 +115,7 @@ if [ "$ALL_TESTS" = true ]; then test1 $REPO_LINK test2 $REPO_LINK test3 $REPO_LINK + test4 $REPO_LINK elif [ -n "$TEST_NUM" ]; then case $TEST_NUM in @@ -106,6 +127,8 @@ elif [ -n "$TEST_NUM" ]; then test2 $REPO_LINK;; 3) test3 $REPO_LINK;; + 4) + test4 $REPO_LINK;; *) echo "Error: Invalid test number" die;;