Oleksii Zhurba | a0ac61a | 2018-02-16 17:42:41 -0600 | [diff] [blame] | 1 | additive_dd() { |
| 2 | sudo sh -c "echo '127.0.0.1 $(hostname)' >> /etc/hosts" |
| 3 | sudo mkfs.ext4 /dev/vdb > /dev/null |
| 4 | sudo mkdir -p /mnt/volume |
| 5 | sudo mount /dev/vdb /mnt/volume |
| 6 | |
| 7 | write_4k_res=`sudo -u root dd if=/dev/zero of=/mnt/volume/write_4k.dat oflag=direct bs=4k count=262144 2>&1` |
| 8 | local write_4k=`echo $write_4k_res | awk '{print $14}'` |
| 9 | |
| 10 | write_1m_res=`sudo -u root dd if=/dev/zero of=/mnt/volume/write_1m.dat oflag=direct bs=1M count=1024 2>&1` |
| 11 | local write_1m=`echo $write_1m_res | awk '{print $14}'` |
| 12 | |
| 13 | write_1g_res=`sudo -u root dd if=/dev/zero of=/mnt/volume/write_1g.dat oflag=direct bs=1G count=1 2>&1` |
| 14 | local write_1g=`echo $write_1g_res | awk '{print $14}'` |
| 15 | cat << EOF |
| 16 | { |
| 17 | "title": "Write 4k, 1M, 1G file", |
| 18 | "description": "description", |
| 19 | "chart_plugin": "StackedArea", |
| 20 | "data": [ |
| 21 | ["write_4k", ${write_4k}], |
| 22 | ["write_1M", ${write_1m}], |
| 23 | ["write_1G", ${write_1g}]] |
| 24 | } |
| 25 | |
| 26 | EOF |
| 27 | } |
| 28 | |
| 29 | cat << EOF |
| 30 | { |
| 31 | "additive": [$(additive_dd)], |
| 32 | "complete": [] |
| 33 | } |
| 34 | EOF |