Skip to content

Instantly share code, notes, and snippets.

@meven meven/test_kio.sh Secret
Created Jun 3, 2018

Embed
What would you like to do?
#!/usr/bin/env bash
set -um
# fallocate -l 24M filename
export TIME="\t%E,\t%k"
launch_kioclient(){
kioclient=$1
foldername=$2
nbfiles=$3
filesize=$4
# preparing the folder to delete
cp -a $foldername ${foldername}_test
echo "removing the folder ${foldername}_test using $kioclient containing $nbfiles files of $filesize" | tee -a log
time $kioclient remove "${foldername}_test"
}
benchmark() {
filesize=$1
nbfiles=$2
foldername=$3
if [ ! -d "$foldername" ]; then
mkdir $foldername
echo "creating $nbfiles files of $filesize" | tee -a log
cd $foldername
range=`eval echo {1..$nbfiles}`
for i in $range
do
#if [ ! -f file_$i ]; then
fallocate -l $filesize file_$i
#fi
done
cd ..
fi
#launch_kioclient "kioclient" $foldername
launch_kioclient "$HOME/kde/build/kde/workspace/kde-cli-tools/bin/kioclient5" $foldername $nbfiles $filesize
}
cd /media/meven/multimedia/test/
benchmark 1 100000 tiny_files
benchmark 1k 100000 small_files
benchmark 3m 1000 medium_files
benchmark 1g 3 big_files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.