# text report by remoteIP:port sub text_sock_report_byrip() { my $pid, my $avg, my $rip, my $type, my $cmd; for $rip (keys %sock_total) { print "Report on remote host: $rip\n"; for $pid (keys %{$sock_total{$rip}}) { printf("pid: %s\n",$pid); for $type (keys %{$sock_total{$rip}{$pid}}) { printf("\t%s, ",$type); printf("\tcnt: %8d, ",$sock_total{$rip}{$pid}{$type}{'cnt'}); $avg = $sock_total{$rip}{$pid}{$type}{'tot'} / $sock_total{$rip}{$pid}{$type}{'cnt'}; printf("\tavg: %12.6f, ",$avg); printf("\tmin: %12.6f, ",$sock_total{$rip}{$pid}{$type}{'min'}); printf("\tmax: %12.6f\n",$sock_total{$rip}{$pid}{$type}{'max'}); } } } }