Skip to content

Instantly share code, notes, and snippets.

@iandow
Created January 1, 2017 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandow/8074962f6205552c9cdc3fceccdd9793 to your computer and use it in GitHub Desktop.
Save iandow/8074962f6205552c9cdc3fceccdd9793 to your computer and use it in GitHub Desktop.
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