# The print_results() prints out a tidy results summary

# print the results
sub print_results {
    my $s = shift;
    my $throughput       = sprintf "%3.2f",$s->{bytes}      / $s->{elapsed};
    my $resp_time        = sprintf "%3.2f",$s->{trans_time} / $s->{count};
    my $trans_rate       = sprintf "%3.2f",$s->{count}      / $s->{elapsed};
    my $concurrency      = sprintf "%3.1f",$s->{trans_time} / $s->{elapsed};
    my $elapsed          = sprintf "%3.3f",$s->{elapsed};
    print STDOUT <<EOF;
Transactions:           $s->{count}
Elapsed time:           $elapsed sec
Bytes Transferred:      $s->{bytes} bytes
Response Time:          $resp_time sec
Transaction Rate:       $trans_rate trans/sec
Throughput:             $throughput bytes/sec
Concurrency:            $concurrency
EOF
    for my $code (sort {$a <=> $b} keys %{$s->{status}}) {
         print "Status Code $code:        $s->{status}->{$code}\n";
    }
}