Update NEWS files for next release
[ACE_TAO.git] / ACE / apps / JAWS / clients / WebSTONE / bin / wscollect.pl
blobb2f14428477a4b45e0aa03195441ffcaadb41c20
1 #!/pkg/gnu/bin//perl
3 # $Header$
4 # updated version of the old wscollect script which goes through
5 # webstone run directories and summarizes the output in tabular
6 # format.
7 # syc 4/25/96
10 require "find.pl";
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
24 local( @runs,
25 %numclients,
26 %connrate,
27 %littlesload,
28 %latency,
29 %error,
30 %throughput);
32 # Got rid of the trick hack of the title names, someone can put it
33 # back in later
34 @title = ( "Timestamp",
35 "Total number of clients",
36 "Connection rate average (conn/s)",
37 "Little's Load Factor",
38 "Average Latency (seconds)",
39 "Error Level (%)",
40 "Throughput avg. for all connections (MBits/s)");
43 push( @ARGV, ".") if ( !@ARGV );
45 for (@ARGV) {
46 &find( $_ );
49 &PrintOutput;
53 sub wanted {
54 local( $filename ) = $_;
56 return unless ( $filename =~ /run/ );
58 local( $instats) = 0;
59 local( $runtime, $tag, $data, $cruft, @cruft );
61 open( FILE, $filename ) || return; # bail if failed to open
62 $runtime = `pwd`;
63 @cruft = split(/\//,$runtime);
64 $runtime = pop( @cruft);
65 chop( $runtime);
66 push( @runs, $runtime);
67 while ( $line = <FILE>) {
68 if (! $instats) {
69 $instats = 1 if ( $line =~ /^WEBSTONE 2\.0 results/ );
70 next;
72 chop( $line );
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);
89 close( FILE );
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
97 sub printdata {
98 local ($timestamp, $num_clients, $conn_rate,
99 $load, $latency, $error, $tput) = @_;
100 format STDOUT =
101 @<<<<<<<<<<< @###### @######.## @####.## @###.#### @####.#### @######.##
102 $timestamp, $num_clients, $conn_rate, $load, $latency, $error, $tput
105 if (!$printedTitles) {
106 $printedTitles = 1;
107 ($ttimestamp, $tnum_clients, $tconn_rate,
108 $tload, $tlatency, $terror, $ttput) = @title;
109 format STDOUT_TOP =
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 ----------------------------------------------------------------------------
122 # write STDOUT_TOP;
123 } # end if printedTitles
124 write STDOUT;
127 sub PrintOutput {
128 local( $runtime );
130 for $runtime (sort @runs) {
131 &printdata( $runtime, $numclients{ $runtime}, $connrate{ $runtime},
132 $littlesload{ $runtime}, $latency{ $runtime}, $error{ $runtime},
133 $throughput{ $runtime});