-
Notifications
You must be signed in to change notification settings - Fork 66
/
fioparse.sh
756 lines (697 loc) · 27.5 KB
/
fioparse.sh
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
collects I/O related dtrace information into file "ioh.out"
and displays the
OPTIONS:
-h Show this message
-v verbose, include histograms in output
-d include dtrace data in output
-p include I/O latency at percents 95%, 99% and 99.99%
-r r format (includes histograms and percentiles)
EOF
}
# bit of a hack
# shell script takes command line args
# thise args are then passed into perl at command line args
# the perl looks at each commandline arge and sets a
# variable with that name = 1
#
AGRUMENTS=""
VERBOSE=0
DTRACE=0
RPLOTS=0
PERCENTILES=0
while getopts .dhpR:vr. OPTION
do
case $OPTION in
h)
usage
exit 1
;;
v)
ARGUMENTS="$ARGUMENTS verbose"
VERBOSE=1
;;
d)
ARGUMENTS="$ARGUMENTS dtrace"
DTRACE=1
;;
R)
ARGUMENTS="$ARGUMENTS rplots percentiles"
RPLOTS=1
PERCENTILES=1
export TESTNAME=$OPTARG
;;
r)
ARGUMENTS="$ARGUMENTS rplots percentiles"
RPLOTS=1
PERCENTILES=1
echo "please enter a test name:"
read TESTNAME
export TESTNAME=${TESTNAME:-"noname"}
;;
p)
ARGUMENTS="$ARGUMENTS percentiles"
PERCENTILES=1
;;
?)
usage
exit
;;
esac
done
shift $((OPTIND-1))
#echo "opts $@"
# print header line
if [ $RPLOTS -eq 0 ] ; then
echo -n "test users size MB ms min max std IOPS"
if [ $VERBOSE -eq 1 ] ; then
echo -n " 50us 1ms 4ms 10ms 20ms 50ms .1s 1s 2s 2s+"
fi
if [ $PERCENTILES -eq 1 ] ; then
echo -n " 95% 99% 99.5% 99.9% 99.95% 99.99%"
fi
echo " "
fi
for i in $*; do
echo "filename=$i"
cat $i
echo "END"
done | \
perl -e '
$ouputrows=0;
$DEBUG=0;
$CLAT=0;
if ( 1 == $DEBUG ) { $debug=1; }
foreach $argnum (0 .. $#ARGV) {
${$ARGV[$argnum]}=1;
#print "$ARGV[$argnum]=${$ARGV[$argnum]}\n";
}
print "continuting ... \n" if defined ($debug);
# these are all the possible buckets for dtrace
@buckets_dtrace=("1", "2", "4", "8", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072", "262144", "524288", "1048576", "2097152", "4194304", "8388608", "16777216", "33554432");
# these are all the possible buckets for fio histograms:
@buckets_fio=("4","10","20","50","100","250","500","750","1000","2000","4000","10000","20000","50000","100000","250000","500000","750000","1000000","2000000","20000000");
# translation of fio buckets into labels
$buckett{4}="4us";
$buckett{10}="10us";
$buckett{20}="20us";
$buckett{50}="50us";
$buckett{100}=".1ms";
$buckett{250}=".25ms";
$buckett{500}=".5ms";
$buckett{750}=".75ms";
$buckett{1000}="1ms";
$buckett{2000}="2ms";
$buckett{4000}="4ms";
$buckett{10000}="10ms";
$buckett{20000}="20ms";
$buckett{50000}="50ms";
$buckett{100000}=".1s";
$buckett{250000}=".25ms";
$buckett{500000}=".5s";
$buckett{750000}=".75s";
$buckett{1000000}="1s";
$buckett{2000000}="2s";
$buckett{20000000}="2s+";
$bucketr{4}="us4";
$bucketr{10}="us10";
$bucketr{20}="us20";
$bucketr{50}="us50";
$bucketr{100}="us100";
$bucketr{250}="us250";
$bucketr{500}="us500";
$bucketr{750}="us750";
$bucketr{1000}="ms1";
$bucketr{2000}="ms2";
$bucketr{4000}="ms4";
$bucketr{10000}="ms10";
$bucketr{20000}="ms20";
$bucketr{50000}="ms50";
$bucketr{100000}="ms100";
$bucketr{250000}="ms250";
$bucketr{500000}="ms500";
$bucketr{750000}="ms750";
$bucketr{1000000}="s1";
$bucketr{2000000}="s2";
$bucketr{20000000}="s2g";
#@output_buckets=("4","10","20","50","1000","4000","10000","20000","50000","100000","1000000","2000000","20000000");
@output_buckets=("50","1000","4000","10000","20000","50000","100000","1000000","2000000","20000000");
# not used now, just print out a static header
sub hist_head {
printf("test users size MB/s ms IOPS ");
my ($time);
printf(" ");
foreach $time (@buckets_fio) {
if ( $time > $higbucket ) {
printf(" %5s",$buckett{$time});
}
}
printf("\n");
}
sub print_hist {
printf(" ");
$mybucket=0;
# for all possible fo buckets, @buckets_fio is all known fio histogram buckets
if ( $rplot_hist == 1 ) {
@rbuckets_fio=("4","100","250","500","1000","2000","4000","10000","20000","50000","100000","250000","500000","1000000","2000000","20000000");
foreach $curbucket (@rbuckets_fio) {
$label="";
if ($curbucket eq "4" ) {
if ( $labels == 1 ) { $label="us50="; }
printf(",%s%2d",$label, int(${$hist_type}{$curbucket}
+ ${$hist_type}{"10"}
+ ${$hist_type}{"20"}
+ ${$hist_type}{"50"})||0 );
delete ${$hist_type}{"10"};
delete ${$hist_type}{"20"};
delete ${$hist_type}{"50"};
} elsif ( $curbucket eq "1000" ) {
if ( $labels == 1 ) { $label=$bucketr{$curbucket}."="; }
printf(",%s%2d",$label, (${$hist_type}{$curbucket} + ${$hist_type}{"750"})||0 );
delete ${$hist_type}{"750"};
} elsif ( $curbucket eq "1000000" ) {
if ( $labels == 1 ) { $label=$bucketr{$curbucket}."="; }
printf(",%s%2d",$label, int(${$hist_type}{$curbucket}+ ${$hist_type}{"750000"})||0 );
delete ${$hist_type}{"750000"};
# the "20000000" bucket is just a tag for > 2s, so lets call it 5s for graphing purposes
} elsif ( $curbucket eq "20000000" ) {
if ( $labels == 1 ) { $label="s5="; }
printf(",%s%2d",$label, int(${$hist_type}{$curbucket})||0 );
} else {
if ( $labels == 1 ) { $label=$bucketr{$curbucket}."="; }
printf(",%s%2d",$label, int(${$hist_type}{$curbucket})||0 );
}
delete ${$hist_type}{$curbucket};
}
} else {
foreach $curbucket (@{$bucket_list}) {
# printf("curbucket %s >=? %s \n",$curbucket, $output_buckets[$mybucket] );
# output_buckets => the list of buckets to actually output
# bucket_list => buckets possible for this data (fio or dtrace)
# curbucket => is this bucket less the bucket to output? if so add it to
# if the current bucket from curbucket is smaller then our the planed output bucket
# but larger than the last output bucket, then summ it up
# ie if the first output bucket at 1ms, sum up all buckets from 4us to 1ms
# if the next output bucket is 1s, them sum up all bucets from 1ms+ to 1s
if ( $curbucket <= $output_buckets[$mybucket] ) {
# bucket values from fio are in $lat[key]
# bucket values from dtrace are in $dtrace_lat[key]
# printf("hist_type %s{%s}=%s\n",$hist_type,$curbucket, ${$hist_type}{$curbucket});
$bucketu{$output_buckets[$mybucket]}+=${$hist_type}{$curbucket};
} else {
$bucketu{$output_buckets[$mybucket+1]}+=${$hist_type}{$curbucket};
}
delete ${$hist_type}{$curbucket};
# if we reach our output bucket time, then go to the next bucket in all buckets
if ( $curbucket >= $output_buckets[$mybucket] ) {
$mybucket++;
# printf("increase mybucket %s\n",$mybucket);
}
}
# now that weve summed up the fine grain buckets in all buckets into
# the desired courser grain buckets, print out the course grain bucket values
foreach $tu (@output_buckets) {
if ( $bucketu{$tu} > 0 ) {
# for fio stats, each bucket is already a % of total
# for DTrace stats, the values are a count
# transform the DTrace counts into percentage using "iop" the total IOPs
# for fio, $iop is set to 100
# for DTrace its the total IOPs
if ( $rplot_hist == 1 ) {
printf(",%s=%2d",$bucketr{$tu},int( 100*($bucketu{$tu}/$iop) )||0 );
} else {
printf(" %5s",int( 100*($bucketu{$tu}/$iop) ) );
}
} else {
if ( $rplot_hist == 1 ) {
printf(",%s=%2d",$bucketr{$tu},0 );
} else {
printf(" %5s","");
}
}
$bucketu{$tu}=0;
}
}
}
$| = 1;
printf("before input\n") if defined ($debug);
while (my $line = <STDIN>) {
printf("after input\n") if defined ($debug);
chomp($line);
printf("line: %s\n", $line) if defined ($debug);
#job: (g=0): rw=randread, bs=8K-8K/8K-8K, ioengine=psync, iodepth=2
if ( $line =~ m/filename/ ) {
$dir=$line;
$dir =~ s/filename=//;
$dir =~ s/\/.*//;
#print "dir=$dir;\n"
}
if ( $line =~ m/ioengine/ ) {
$bs=$benchmark=$line;
$benchmark =~ s/.* rw=//;
$benchmark =~ s/,.*//;
$bs =~ s/.* bs=//;
$bs =~ s/-.*//;
#printf("benchmark %s bs %s\n",$benchmark, $bs );
#printf(" %s:%s:\n",$benchmark, $bs );
next;
}
# READ: io=48216KB, aggrb=802KB/s, minb=822KB/s, maxb=822KB/s, mint=60052msec, maxt=60052msec
# WRITE: io=12256KB, aggrb=204KB/s, minb=208KB/s, maxb=208KB/s, mint=60052msec, maxt=60052msec
if ( $line =~ m/aggrb/ ) {
$type=$throughput=$line;
$type =~ s/:.*//;
$type =~ s/[ ][ ]*//;
# lower case:
$type = lc( $type);
$throughput =~ s/.*aggrb=//;
$throughput =~ s/,.*//;
printf("throughput:%s:\n",$throughput) if defined ($debug);
$factor = $throughput;
$factor =~ s/.*MB.s/1048576/;
$factor =~ s/.*KB.s/1024/;
$factor =~ s/.*B.s/1/;
$throughput =~ s/MB.s//;
$throughput =~ s/KB.s//;
$throughput =~ s/B.s//;
printf("throughput:%s: factor:%s:\n",$throughput,$factor) if defined ($debug);
$throughput{$type}=$throughput*$factor;
next;
}
# read : io=48216KB, bw=822173 B/s, iops=100 , runt= 60052msec
# get iops and set type for later usage
if ( $line =~ m/ bw=/ ) {
$type=$iops =$line;
$type =~ s/[ ]*:.*//;
$type =~ s/[ ]*//;
$iops =~ s/.*iops=//;
$iops =~ s/ .*//;
#printf(" type:%s; iops:%s; line:%s;\n",$type,$iops,$line);
$iops{$type}=$iops;
next;
}
# lat (usec): min=7 , max=1305.5K, avg=61053.50, stdev=73135.80
if ( $line =~ m/ stdev=/ ) { # filter out histogram lines that have "lat"
if ( $line =~ m/ lat/ ) { # filter out clat lines
$lat=$unit=$latmin=$latmax=$latstd=$line;
$lat =~ s/.*avg=//;
$lat =~ s/,.*//;
$latmin =~ s/.*min=//;
$latmin =~ s/ *,.*//;
$latmax =~ s/.*max=//;
$latmax =~ s/ *,.*//;
$latstd =~ s/.*stdev=//;
$latstd =~ s/ *//;
$unit =~ s/.*\(//;
$unit =~ s/\).*//;
$unit =~ s/msec/1000/;
$unit =~ s/usec/1/;
foreach $var ( "latmin" , "latmax" , "laststd" ) {
if ( ${$var} =~ m/K/ ) {
${$var} =~ s/K//;
${$var} = ${$var} *1000;
}
}
#printf("lat type:%s; lat:%s; min:%s; max:%s; std:%s; line:%s;\n",$type,$lat,$latmin,$latmax,$line);
$latmin{$type}=$latmin*$unit;
$latmax{$type}=$latmax*$unit;
$latstd{$type}=$latstd*$unit;
$lat{$type}=$lat*$unit;
$unit{$type}=$unit;
next;
}
}
# #job: (g=0): rw=randread, bs=8K-8K/8K-8K, ioengine=psync, iodepth=2
if ( $line =~ m/ioengine/ ) {
$bs=$line;
$bs =~ s/.* bs=//;
$bs =~ s/-.*//;
next;
}
#Starting 1 process
if ( $line =~ m/Starting/ ) {
$users=$line;
$users =~ s/Starting //;
$users =~ s/ process.*//;
next;
}
# lat (usec): 4=97.56%, 10=1.10%, 20=0.09%, 50=0.03%, 100=0.01%
# lat (usec): 250=0.01%, 500=0.01%, 750=0.01%
# lat (msec): 4=0.01%, 10=0.50%, 20=0.64%, 50=0.04%, 100=0.01%
# lat (msec): 250=0.01%
# lat (msec): 4=6.20%, 10=15.29%, 20=42.56%, 50=30.58%, 100=2.89%
# lat (msec): 250=0.41%, 750=0.41%, 1000=0.83%, 2000=0.41%, >=2000=0.41%
# 2 4 10 20 50 100 250 500 750 1000 2000 4000 10000 20000 50000
# 100000 250000 500000 750000 1000000 2000000 2000000+
if ( $line =~ m/ lat / ) {
if ( $line =~ m/%/ ) {
# printf("line=%s;\n",$line);
$units=$lats=$line;
$units =~ s/.*\(//;
$units =~ s/\).*//;
$units =~ s/msec/1000/;
$units =~ s/usec/1/;
$lats =~ s/.*://;
$lats =~ s/%//g;
$lats =~ s/>=/Z/g;
@lats = split(",", $lats);
foreach $lat (@lats) {
($key,$val) = split("=", $lat);
if ( $key =~ m/Z/ ) {
$key=20000000;
$extra="+";
} else {
$key=$key*$units;
$extra="";
}
$lat{$key}=$val;
}
}
}
# clat percentiles (usec):
# | 1.00th=[ 179], 5.00th=[ 185], 10.00th=[ 191], 20.00th=[ 195],
# | 30.00th=[ 199], 40.00th=[ 201], 50.00th=[ 203], 60.00th=[ 207],
# | 70.00th=[ 215], 80.00th=[ 219], 90.00th=[ 229], 95.00th=[ 266],
# | 99.00th=[ 398], 99.50th=[ 474], 99.90th=[ 532], 99.95th=[ 796],
# | 99.99th=[ 1352]
# bw (KB/s) : min=33040, max=38352, per=100.00%, avg=36799.16, stdev=1312.23
if ( $CLAT == 1 ) {
# printf("CLAT == 1\n");
if ( $line =~ m/\|/ ) {
#printf("CLAT == 1 and found pipe, line:%s\n",$line);
#printf("CLAT line:%s\n",$line);
if ( $line =~ m/95.00th/ ) {
$clat95_00 = $line;
$clat95_00 =~ s/.*95.00th=\[//;
$clat95_00 =~ s/\],.*//;
$clat95_00 =~ s/ //g;
#printf("95.00th:%s\n",$clat95_00);
}
if ( $line =~ m/99.00th/ ) {
$line =~ s/99\...th.*?=\[//g;
$line =~ s/\|//g;
$line =~ s/\]//g;
$line =~ s/ //g;
($clat99_00, $clat99_50, $clat99_90, , $clat99_95 )=split(",",$line);
#printf("99.00th:%s\n",$line);
#printf("99.00th:%s\n",$clat99_00);
#printf("99.50th:%s\n",$clat99_50);
#printf("99.90th:%s\n",$clat99_90);
#printf("99.95th:%s\n",$clat99_95);
}
if ( $line =~ m/99.99th/ ) {
$clat99_99 = $line;
$clat99_99 =~ s/.*99.99th=\[//;
$clat99_99 =~ s/\].*//;
$clat99_99 =~ s/ //g;
#printf("99.99th:%s\n",$clat99_99);
}
} else {
#printf("CLAT == 1 and no piple, line:%s\n",$line);
$CLAT = 0;
}
}
if ( $line =~ m/clat percentiles / ) {
$CLAT=1 ;
# clat percentiles (usec):
$clat_unit=$line ;
$clat_unit =~ s/.*\(//;
$clat_unit =~ s/\).*//;
#printf("clat unit:%s:\n",$clat_unit);
if ( $clat_unit eq "usec" ) {
$clat_mult = .001 ;
} elsif ( $clat_unit eq "msec" ) {
$clat_mult = 1;
} elsif ( $clat_unit eq "sec" ) {
$clat_mult = 1000;
} else {
printf("clat unit :%s: unknown\n",$clat_unit);
printf("exiting \n");
exit;
}
#printf("clat mult:%s:\n",$clat_mult);
#printf("CLAT line:%s\n",$line);
}
# important for the follwoing dtrace lines, get rid of spaces and tabs
$line=~ s/[ ][ ]/,/;
$line =~ s/[ ][ ]*//g;
if ( $line =~ m/dtrace_secs/ ) {
($type, $value)=split(",",$line);
$dtrace_secs=$value;
# $dtrace=1;
# printf("%s %s %s\n", $dtrace_io_type,$type,$value);
}
if ( $line =~ m/dtrace_avgsize/ ) {
($dtrace_io_type,$type, $value)=split(",",$line);
$dtrace_avgsize{$dtrace_io_type}=$value;
# printf("%s %s %s\n", $dtrace_io_type,$type,$value);
}
if ( $line =~ m/dtrace_bytes/ ) {
($dtrace_io_type,$type, $value)=split(",",$line);
$dtrace_bytes{$dtrace_io_type}=$value;
# printf("%s %s %s :%s:\n", $dtrace_io_type,$type,$value,$dtrace_bytes{$dtrace_io_type});
}
if ( $line =~ m/dtrace_avglat/ ) {
($dtrace_io_type,$type, $value)=split(",",$line);
$value =~ s/[ ][ ]*//g;
$value =~ s/ *//g;
$dtrace_avglat{$dtrace_io_type}=$value;
# printf("%s %s %s\n", $dtrace_io_type,$type,$value);
}
if ( $line =~ m/dtrace_iop/ ) {
($dtrace_io_type,$type, $value)=split(",",$line);
$dtrace_iop{$dtrace_io_type}=$value;
# printf("%s %s %s\n", $dtrace_io_type,$type,$value);
}
if ( $line =~ m/dtrace_size_start/ ) { $dtrace_size=1; }
if ( $line =~ m/size_distribution/ ) { ($dtrace_io_type, $value)=split(",",$line);}
if ( $line =~ m/dtrace_size_end/ ) { $dtrace_size=0; }
if ( $line =~ m/dtrace_latency_start/ ) { $dtrace_latency=1; }
if ( $line =~ m/latency_distribution/ ) { ($dtrace_io_type, $value)=split(",",$line);}
if ( $line =~ m/dtrace_latency_end/ ) { $dtrace_latency=0; }
#
if ( $line =~ m/\|/ ) {
# printf("dtrace %s\n", $line);
$line=~ s/\|@*/,/;
$line =~ s/ *//g;
if ( $dtrace_size == 1 ) {
# printf("dtrace_size %s\n", $line);
($bucket, $value)=split(",",$line);
$size{$dtrace_io_type,$bucket}=$val;
}
# 128, 0
# 256 , 1
# 512 , 23
# 1024 ,8
# 2048 ,2
if ( $dtrace_latency == 1 ) {
# printf("dtrace_late %s\n", $line);
($bucket, $value)=split(",",$line);
if ( $dtrace_io_type eq "W" ) {
$dtrace_lat_w{$bucket}=$value;
if ( $bucket > $max_dtrace_w_bucket ) { $max_dtrace_w_bucket = $bucket }
# printf("w dtrace_late bucket,value :%s:%s:\n", $bucket,$value);
}
if ( $dtrace_io_type eq "R" ) {
$dtrace_lat_r{$bucket}=$value;
if ( $bucket > $max_dtrace_r_bucket ) { $max_dtrace_r_bucket = $bucket }
# printf("r dtrace_late bucket,value :%s:%s:\n", $bucket,$value);
}
}
}
#
# PRINTING OUT
#
if ( $line =~ m/END/ ) {
if ( $rplots == 0 ) {
#hist_head;
printf("%8s", $benchmark);
printf("%3s", $users);
printf("%5s", $bs);
# foreach $type ( "read", "write" ) {
# $type = "read" ;
if ( $benchmark eq "write" ) {
$type="write" ;
$dtype="W" ;
} else {
$type="read" ;
$dtype="R" ;
}
if ( $iops{$type} > 0 ) {
printf(" %-1.1s", $type);
printf("%9.3f", $throughput{$type}/1048576);
printf("%9.3f", $lat{$type}/1000);
printf("%9.3f", $latmin{$type}/1000);
printf("%9.3f", $latmax{$type}/1000);
printf("%9.3f", $latstd{$type}/1000);
#printf("%8s", $unit{$type});
printf("%8s", $iops{$type});
} else {
printf("%27s ", "");
}
# }
if ( $verbose == 1 ) {
$iop=100;
$hist_type="lat";
$bucket_list= "buckets_fio";
print_hist;
if ( $dtrace == 1 ) {
printf("\n");
#printf("%8s", $benchmark);
#printf("%3s", $users);
printf("%8s", "");
printf("%3s", "");
if ( $dtrace_avgsize{$dtype} > 1000*1024 ) {
printf("%4dM d",$dtrace_avgsize{$dtype}/(1024*1024)); # type
} else {
printf("%4sK d",int($dtrace_avgsize{$dtype}/1024)); # type
}
if ( $dtrace_secs == 0 ) { $dtrace_secs = 1; }
printf("%9.3f", ($dtrace_bytes{$dtype}/$dtrace_secs)/(1024*1024) ); # throughout MB/s
printf("%9s", $dtrace_avglat{$dtype}/1000); # latency
printf("%27s", "");
printf("%8s", int($dtrace_iop{$dtype}/$dtrace_secs) ); # iops
# if ( $dtrace_iop{"W"} > 0 ) {
# printf("%1s", "");
# printf("%9.3f", ($dtrace_bytes{"W"}/$dtrace_secs)/(1024*1024) ); # throughout MB/s
# printf("%9s", $dtrace_avglat{"W"}/1000); # latency
# printf("%8s", int($dtrace_iop{"W"}/$dtrace_secs) ); # iops
# } else {
# printf("%27s", "");
# }
# #printf(" ");
# this will be the read latency histogram
# more work to be done to fiture out how/when to do write histogram
$iop=$dtrace_iop{$dtype};
if ( $dtype eq "R" ) {
$hist_type="dtrace_lat_r";
$max_dtrace_bucket = $max_dtrace_r_bucket;
} else {
$hist_type="dtrace_lat_w" ;
$max_dtrace_bucket = $max_dtrace_w_bucket;
}
$bucket_list= "buckets_dtrace";
print_hist;
$max_dtrace_bucket = 0
} # end dtrace
} # end verbose
if ( $percentiles == 1 ) {
foreach $percent ( $clat95_00, $clat99_00 ,$clat99_50 ,$clat99_90 ,$clat99_95 ,$clat99_99 ) {
printf(",%8.3f",$percent*$clat_mult);
}
} # end percentile
printf("\n");
$users="";
$benchmark="";
foreach $type ( keys %iops ) {
delete $throughput{$type};
delete $lat{$type};
delete $iops{$type};
}
$type="";
$benchmark="";
$users="";
$bs="";
$dtrace_avgsize="";
$dtrace_bytes="";
$dtrace_secs="";
$dtrace_avglat="";
} # end rplots = 0
if( $rplots == 1 ) {
if ( $line =~ m/END/ && $users > 0 ) {
if ( $benchmark eq "write" ) {
$type="write" ;
$dtype="W" ;
} else {
$type="read" ;
$dtype="R" ;
}
if ( $outputrows > 0 ) {
if ( $labels == 1 ) {
printf("m <- rbind(m,data.frame(");
} else {
printf(",");
}
} else {
printf("m <- NULL \n");
if ( $labels == 1 ) {
printf("m <- data.frame(");
} else {
printf("m <- matrix(c(\n");
}
}
#printf("name=\"%s\",", $benchmark);
#printf("name=\"%s\",", $dir);
#$tmpname= "\"" . $benchmark . "\"";
#printf("name=%10s,", $tmpname );
$label="";
if ( $labels == 1 ) { $label="name=";}
printf("%s%10s,", $label, "\"" . $benchmark . "\"") ;
if ( $labels == 1 ) { $label="users=";}
printf("%s%3s,", $label, $users);
if ( $labels == 1 ) { $label="bs=";}
printf("%s%6s,", $label, "\"" . $bs . "\"") ;
#printf("%s,", $type);
if ( $labels == 1 ) { $label="MB=";}
printf("%s%8.3f,", $label, $throughput{$type}/1048576);
if ( $labels == 1 ) { $label="lat=";}
printf("%s%9.3f,", $label, $lat{$type}/1000);
if ( $labels == 1 ) { $label="min=";}
printf("%s%4.1f,", $label, $latmin{$type}/1000);
if ( $labels == 1 ) { $label="max=";}
printf("%s%9d,", $label, $latmax{$type}/1000);
if ( $labels == 1 ) { $label="std=";}
printf("%s%7.1f,", $label, $latstd{$type}/1000);
#printf("%s,", $unit{$type});
if ( $labels == 1 ) { $label="iops=";}
printf("%s%5s", $label, $iops{$type});
$iop=100;
$hist_type="lat";
$bucket_list= "buckets_fio";
$rplot_hist = 1;
print_hist;
$rplot_hist = 0;
foreach $percent ( $clat95_00, $clat99_00 ,$clat99_50 ,$clat99_90 ,$clat99_95 ,$clat99_99 ) {
printf(",%5.3f",$percent*$clat_mult);
}
if ( $outputrows > 0 && $labels == 1 ) { printf(")"); }
if ( $lables == 1 ) { printf(")"); }
printf("\n" );
$outputrows++;
} # end line=END and users > 0
} # end rplots = 1
}
} # end of STDIN
if( $rplots == 1 ) {
if ( $lables != 1 ) {
if ( $percentiles == 1 ) {
printf("),nrow=31)\n");
} else {
printf("),nrow=25)\n");
}
printf("tm <- t(m)\n");
printf("m <-tm\n");
printf("colnames <- c(\"name\",\"users\",\"bs\",\"MB\",\"lat\",\"min\",\"max\",\"std\",\"iops\"\n");
printf(", \"us50\",\"us100\",\"us250\",\"us500\",\"ms1\",\"ms2\",\"ms4\",\"ms10\",\"ms20\"\n");
printf(", \"ms50\",\"ms100\",\"ms250\",\"ms500\",\"s1\",\"s2\",\"s5\"\n");
if ( $percentiles == 1 ) {
printf(",\"p95_00\", \"p99_00\", \"p99_50\", \"p99_90\", \"p99_95\", \"p99_99\"\n");
}
printf(")\n");
printf("colnames(m)=colnames\n");
printf("m <- data.frame(m)\n");
printf("testtype <- \"%s\"\n",$ENV{'TESTNAME'});
}
#printf("name <- \"%s\" \n", $dir );
#printf("if ( exists(\"total\") ) { \n");
#printf(" total <- rbind ( total, list( name=name, matrix=m )) \n");
#printf("} else { \n");
#printf(" total <- list( name=name, matrix=m )\n");
#printf("} \n");
}
printf("at end\n") if defined ($debug);
' $ARGUMENTS