Instantly share code, notes, and snippets.

Embed
What would you like to do?
MESSAGES=1000000
MSGSIZE=100
maprcli stream delete -path /user/mapr/iantest >& /dev/null
maprcli stream create -path /user/mapr/iantest -produceperm p -consumeperm p -topicperm p
mapr perfproducer -path /user/mapr/iantest | tail -n 12 | grep ":" | awk -F ":" '{printf "%s, ",$1}' >> partitions.csv
echo "numPartitions, numMsgs, sizeMsg, eth0 TX kB/s, eth0 RX kB/s" >> partitions.csv
maprcli stream delete -path /user/mapr/iantest >& /dev/null
for NUMPARTITIONS in 1 2 3 4 5 6 7 8 9 10 15 20 25 30 35 40 45 50 60 70 80 90 100 150 200 250 300 350 400; do
maprcli stream create -path /user/mapr/iantest -produceperm p -consumeperm p -topicperm p -defaultpartitions $NUMPARTITIONS
echo "Running 10 iterations for paritions = $NUMPARTITIONS"
for i in `seq 1 10`; do
R1=`cat /sys/class/net/eth0/statistics/rx_bytes`
T1=`cat /sys/class/net/eth0/statistics/tx_bytes`
SECONDS=0
mapr perfproducer -path /user/mapr/iantest -ntopics 1 -npart $NUMPARTITIONS -nmsgs $MESSAGES -msgsz $MSGSIZE | tail -n 12 | grep ":" | awk '{printf "%s, ",$NF}' >> partitions.csv
duration=$SECONDS
R2=`cat /sys/class/net/eth0/statistics/rx_bytes`
T2=`cat /sys/class/net/eth0/statistics/tx_bytes`
TBPS=`expr $T2 - $T1`
RBPS=`expr $R2 - $R1`
TKBPS=`expr $TBPS / 1024 / $duration`
RKBPS=`expr $RBPS / 1024 / $duration`
echo -n "$NUMPARTITIONS, $MESSAGES, $MSGSIZE" >> partitions.csv
echo ", $TKBPS, $RKBPS" >> partitions.csv
done
# cleanup
maprcli stream delete -path /user/mapr/iantest >& /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment