-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfio-cdm
executable file
·119 lines (103 loc) · 3.18 KB
/
fio-cdm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
TARGET="$1"
#fio2cdm() {
# awk '
# /^Seq-Read:/ {getline;if($1~/^read/) {seqread =$4}}
# /^Seq-Write:/ {getline;if($1~/^write/){seqwrite=$3}}
# /^Rand-Read-512K:/ {getline;if($1~/^read/) {rread512 =$4}}
# /^Rand-Write-512K:/ {getline;if($1~/^write/){rwrite512=$3}}
# /^Rand-Read-4K:/ {getline;if($1~/^read/) {rread4 =$4}}
# /^Rand-Write-4K:/ {getline;if($1~/^write/){rwrite4=$3}}
# /^Rand-Read-4K-QD32:/ {getline;if($1~/^read/) {rread4qd32 =$4}}
# /^Rand-Write-4K-QD32:/{getline;if($1~/^write/){rwrite4qd32=$3}}
# function n(i) {
# split(gensub(/bw=([0-9.]+)(([KM]?)B\/s,)?/,"\\1 \\3", "g", i), a);
# s = a[1]; u = a[2];
# if(u == "K") {s /= 1024}
# if(u == "") {s /= 1024 * 1024}
# return s;
# }
# END {
# print(seqread);
# print ("| | Read(MB/s)|Write(MB/s)|");
# print ("|------|-----------|-----------|");
# printf("| Seq |%11.3f|%11.3f|\n", n(seqread), n(seqwrite));
# printf("| 512K |%11.3f|%11.3f|\n", n(rread512), n(rwrite512));
# printf("| 4K |%11.3f|%11.3f|\n", n(rread4), n(rwrite4));
# printf("|4KQD32|%11.3f|%11.3f|\n", n(rread4qd32),n(rwrite4qd32));
# }
# '
#}
fio2cdm() {
awk -F ';' '
$3 == "Seq-Read" { seqread=$7 ; seqreadio=$8 }
$3 == "Seq-Write" { seqwrite=$48 ; seqwriteio=$49 }
$3 == "Rand-Read-512K" { rread512=$7 ; rread512io=$8 }
$3 == "Rand-Write-512K" { rwrite512=$48 ; rwrite512io=$49 }
$3 == "Rand-Read-4K" { rread4=$7 ; rread4io=$8 }
$3 == "Rand-Write-4K" { rwrite4=$48 ; rwrite4io=$49 }
$3 == "Rand-Read-4K-QD32" { rread4qd32=$7 ; rread4qd32io=$8 }
$3 == "Rand-Write-4K-QD32" { rwrite4qd32=$48 ; rwrite4qd32io=$49 }
function n(i) {
return i/1024;
}
END {
print ("| | Read(MB/s) / IOPS|Write(MB/s) / IOPS|");
print ("|------|--------------------|--------------------|");
printf("| Seq |%11.3f / %6d|%11.3f / %6d|\n", n(seqread), seqreadio, n(seqwrite), seqwriteio);
printf("| 512K |%11.3f / %6d|%11.3f / %6d|\n", n(rread512), rread512io, n(rwrite512), rwrite512io);
printf("| 4K |%11.3f / %6d|%11.3f / %6d|\n", n(rread4), rread4io, n(rwrite4), rwrite4io);
printf("|4KQD32|%11.3f / %6d|%11.3f / %6d|\n", n(rread4qd32), rread4qd32io,n(rwrite4qd32),rwrite4qd32io);
}
'
}
trap "rm -f ${TARGET}/.fio-diskmark" 0 1 2 3 9 15
if [ -z "$TARGET" ] ; then
echo "First argument should be target directory."
exit 1
fi
# see. http://www.winkey.jp/article.php/20110310142828679
cat <<_EOL_ | fio --output-format=terse - | fio2cdm
[global]
ioengine=libaio
iodepth=1
size=1g
direct=1
runtime=60
directory=${TARGET}
filename=.fio-diskmark
[Seq-Read]
bs=1m
rw=read
stonewall
[Seq-Write]
bs=1m
rw=write
stonewall
[Rand-Read-512K]
bs=512k
rw=randread
stonewall
[Rand-Write-512K]
bs=512k
rw=randwrite
stonewall
[Rand-Read-4K]
bs=4k
rw=randread
stonewall
[Rand-Write-4K]
bs=4k
rw=randwrite
stonewall
[Rand-Read-4K-QD32]
iodepth=32
bs=4k
rw=randread
stonewall
[Rand-Write-4K-QD32]
iodepth=32
bs=4k
rw=randwrite
stonewall
_EOL_