4 # updated version of the old wscollect script which goes through
5 # webstone run directories and summarizes the output in tabular
13 # the list @runs contains the timestamps for the runs which are found
14 # during the traversal of the runs directory. This list is used for
15 # indices into the associative arrays for storing run information.
17 # $numclients{ $time } - number of clients for the run
18 # $connrate{ $time } - connection rate average
19 # $littlesload{ $time } - little's load factor
20 # $latency{ $time } - latency average
21 # $error{ $time } - error rate
22 # $throughput{ $time } - throughput
32 # Got rid of the trick hack of the title names, someone can put it
34 @title = ( "Timestamp",
35 "Total number of clients",
36 "Connection rate average (conn/s)",
37 "Little's Load Factor",
38 "Average Latency (seconds)",
40 "Throughput avg. for all connections (MBits/s)");
43 push( @ARGV, ".") if ( !@ARGV );
54 local( $filename ) = $_;
56 return unless ( $filename =~ /run/ );
59 local( $runtime, $tag, $data, $cruft, @cruft );
61 open( FILE
, $filename ) || return; # bail if failed to open
63 @cruft = split(/\//,$runtime);
64 $runtime = pop( @cruft);
66 push( @runs, $runtime);
67 while ( $line = <FILE
>) {
69 $instats = 1 if ( $line =~ /^WEBSTONE 2\.0 results/ );
73 ( $tag, $data ) = split( /:?\s{2,}|\t/, $line);
75 # perl hack to emulate case/switch statement
76 $tag =~ /number of clients/ &&
77 ($numclients{ $runtime } = $data, next);
78 $tag =~ /error rate/ &&
79 (( $error{ $runtime }) = $data =~ /([\d\.]+)/, next);
80 $tag =~ /connection rate/ &&
81 (( $connrate{ $runtime }) = $data =~ /([\d\.]+)/, next);
82 $tag =~ /Server thruput/ &&
83 (( $throughput{ $runtime }) = $data =~ /([\d\.]+)/, next);
84 $tag =~ /Little's Load/ &&
85 (( $littlesload{ $runtime}) = $data =~ /([\d\.]+)/, next); # '
86 $tag =~ /Average response time/ &&
87 (( $latency{ $runtime } ) = $data =~ /([\d\.]+)/, next);
90 unless ( $throughput{ $runtime} ) {
91 pop( @runs); # if we didn't get a throughput, then the
92 # data is incomplete and just drop this run
98 local ($timestamp, $num_clients, $conn_rate,
99 $load, $latency, $error, $tput) = @_;
101 @
<<<<<<<<<<< @
###### @######.## @####.## @###.#### @####.#### @######.##
102 $timestamp, $num_clients, $conn_rate, $load, $latency, $error, $tput
105 if (!$printedTitles) {
107 ($ttimestamp, $tnum_clients, $tconn_rate,
108 $tload, $tlatency, $terror, $ttput) = @title;
110 ^||||||||||| ^||||||| ^||||||||| ^||||||| ^||||||||| ^||||||||| ^|||||||||||
111 $ttimestamp, $tnum_clients, $tconn_rate, $tload, $tlatency, $terror, $ttput
112 ^||||||||||| ^||||||| ^||||||||| ^||||||| ^||||||||| ^||||||||| ^|||||||||||
113 $ttimestamp, $tnum_clients, $tconn_rate, $tload, $tlatency, $terror, $ttput
114 ^||||||||||| ^||||||| ^||||||||| ^||||||| ^||||||||| ^||||||||| ^|||||||||||
115 $ttimestamp, $tnum_clients, $tconn_rate, $tload, $tlatency, $terror, $ttput
116 ^||||||||||| ^||||||| ^||||||||| ^||||||| ^||||||||| ^||||||||| ^|||||||||||
117 $ttimestamp, $tnum_clients, $tconn_rate, $tload, $tlatency, $terror, $ttput
118 ^||||||||||| ^||||||| ^||||||||| ^||||||| ^||||||||| ^||||||||| ^|||||||||||
119 $ttimestamp, $tnum_clients, $tconn_rate, $tload, $tlatency, $terror, $ttput
120 ----------------------------------------------------------------------------
123 } # end if printedTitles
130 for $runtime (sort @runs) {
131 &printdata
( $runtime, $numclients{ $runtime}, $connrate{ $runtime},
132 $littlesload{ $runtime}, $latency{ $runtime}, $error{ $runtime},
133 $throughput{ $runtime});