summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdisk-benchmark20
1 files changed, 13 insertions, 7 deletions
diff --git a/disk-benchmark b/disk-benchmark
index 77475cf..5f9ab42 100755
--- a/disk-benchmark
+++ b/disk-benchmark
@@ -1,19 +1,25 @@
#!/bin/sh
-for i in {0..4}; do
-echo
echo "WRITE SPEED"
-dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
+for i in {0..2}; do
+ A=$(dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc 2>&1 | tail -1 | cut -d " " -f 8-)
+ echo $A
+done
echo
echo "READ SPEED"
-echo 3 > /proc/sys/vm/drop_caches
-dd if=tempfile of=/dev/null bs=1M count=1024
+for i in {0..2}; do
+ echo 3 > /proc/sys/vm/drop_caches
+ A=$(dd if=tempfile of=/dev/null bs=1M count=1024 2>&1 | tail -1 | cut -d " " -f 8-)
+ echo $A
+done
echo
echo "BUFFERED READ SPEED"
-dd if=tempfile of=/dev/null bs=1M count=1024
+for i in {0..2}; do
+ A=$(dd if=tempfile of=/dev/null bs=1M count=1024 2>&1 | tail -1 | cut -d " " -f 8-)
+ echo $A
+done
rm tempfile
-done