Last active
June 24, 2019 20:09
-
-
Save stefanbenten/cde0b0ce412e876f7c28886f6d240022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BUCKET="srv11" | |
FILE="500M.data" | |
FILEPATH="/root/load-test" | |
THREAD=`date +%Y%m%d%H%M%S` | |
LOG="logs/$THREAD.log" | |
DEBUG="trace" | |
UPLOADLOG="logs/$THREAD-detailed.log" | |
PARAMS="--config-dir ./uplink --log.level debug --log.output $UPLOADLOG --debug.trace-out $DEBUG/$THREAD/$i-up.trace --profile.cpu $DEBUG/$THREAD/$i-up-cpu.profile --profile.mem $DEBUG/$THREAD/$i-up-mem.profile" | |
mkdir /tmp/$THREAD/ | |
mkdir $DEBUG/$THREAD/ | |
echo "Network Test with File $FILE and $1 iterations" >> $LOG | |
echo "The following metrics are kept:" >> $LOG | |
echo "Operation - FileCount - Time in seconds" >> $LOG | |
for i in `seq 1 $1`; | |
do | |
echo "File $i of $1" | |
START=$(date +%s.%N) | |
uplink $PARAMS cp $FILEPATH/$FILE sj://$BUCKET/$THREAD/$i-$FILE | |
END=$(date +%s.%N) | |
DIFF=$(echo "$END - $START" | bc) | |
echo "Upload - $i - $DIFF s" >> $LOG | |
for j in `seq 1 $2`; | |
do | |
START=$(date +%s.%N) | |
uplink $PARAMS cp sj://$BUCKET/$THREAD/$i-$FILE /tmp/$THREAD/$i-$FILE | |
END=$(date +%s.%N) | |
DIFF=$(echo "$END - $START" | bc) | |
echo "Download - $i - $DIFF s" >> $LOG | |
rm /tmp/$THREAD/$i-$FILE | |
done | |
#START=$(date +%s.%N) | |
#uplink $PARAMS rm sj://$BUCKET/$THREAD/$i-$FILE | |
#END=$(date +%s.%N) | |
#DIFF=$(echo "$END - $START" | bc) | |
#echo "Delete - $i - $DIFF s" >> $LOG | |
done | |
rm -r /tmp/$THREAD/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script assumes the following:
FILEPATH
and namesFILE
logs
andtrace
in the directory where the script is ran.BUCKET
, it does not generate it for youAll parameters of the actual uplink command can be appended/changed in L10.
To run execute it in the following schema:
./upload-v3.sh <AMOUNTOFUPLOADS> <AMOUNTOFDOWNLOADSPERFILE>
This will run the script and output two log files named by the startdate (this contains the actual upload and download times) and one with the suffix
-detailed
, which contains all debug logs of the uploads.