10 my (@x) = split /\s+/, $_;
12 my $num_packets = scalar @x;
13 my $num_drops = grep { /\*/ } @x;
15 $buckets{$num_packets}->{'num_bursts'}++;
16 $buckets{$num_packets}->{'num_drops'} += $num_drops;
18 $buckets{$num_packets}->{'bursts_with_drops'}++;
22 for my $n (sort { $a <=> $b } keys %buckets) {
23 my $drop_rate = $buckets{$n}->{'num_drops'} / ($n * $buckets{$n}->{'num_bursts'});
24 my $drop_event_rate = ($buckets{$n}->{'bursts_with_drops'} // 0) / $buckets{$n}->{'num_bursts'};
25 printf "%3d: drop_rate %.5f drop_event_rate %.5f\n",
26 $n, $drop_rate, $drop_event_rate;