X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=summarize.pl;h=050aabb8bd26ebff95f1862fe032cbf24e4e5bb2;hb=43ca3bfe7b2b9cd965eb488c2c2a79377730eb95;hp=813023d131258b8a8794d990583cc5d2945d42ba;hpb=e8b62bdc57547ed165ff8d94592149250973e86c;p=bursty diff --git a/summarize.pl b/summarize.pl index 813023d..050aabb 100755 --- a/summarize.pl +++ b/summarize.pl @@ -20,8 +20,13 @@ while (<>) { } for my $n (sort { $a <=> $b } keys %buckets) { - my $drop_rate = $buckets{$n}->{'num_drops'} / ($n * $buckets{$n}->{'num_bursts'}); - my $drop_event_rate = ($buckets{$n}->{'bursts_with_drops'} // 0) / $buckets{$n}->{'num_bursts'}; - printf "%3d: drop_rate %.5f drop_event_rate %.5f\n", - $n, $drop_rate, $drop_event_rate; + my $num_bursts = $buckets{$n}->{'num_bursts'} // 0; + my $num_drops = $buckets{$n}->{'num_drops'} // 0; + my $bursts_with_drops = $buckets{$n}->{'bursts_with_drops'} // 0; + + my $drop_rate = $num_drops / ($n * $num_bursts); + my $drop_event_rate = $bursts_with_drops / $num_bursts; + printf "%3d: drop_rate %.5f (%4d/%8d) drop_event_rate %.5f (%3d/%4d)\n", + $n, $drop_rate, $num_drops, $n * $num_bursts, + $drop_event_rate, $bursts_with_drops, $num_bursts; }