Skip to content

Instantly share code, notes, and snippets.

@saurabhwahile
Created May 24, 2015 09:07
Show Gist options
  • Save saurabhwahile/609e9a6c5f0697d0ad43 to your computer and use it in GitHub Desktop.
Save saurabhwahile/609e9a6c5f0697d0ad43 to your computer and use it in GitHub Desktop.
Measure disk performance on linux
repeat=10
while [ $x -gt 0 ]
do
python "C:\\Python27\\lib\\timeit.py" -n 3 "f = open('file.txt', 'wb+'); f.write('chunk'); f.close()" >> results.txt
repeat=$((repeat-1))
done
data="$(awk '{print $6}' results.txt)"
echo $data
python -c "results = map(float, \"\"\"$data\"\"\".split('\n')); from matplotlib import pyplot; pyplot.plot(range(1,11), results); pyplot.savefig('results.png')"
rm results.txt
rm file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment