Browse Source

Have parse_output also output the bandwidths

Ian Goldberg 1 year ago
parent
commit
4acdaa86b3
1 changed files with 25 additions and 0 deletions
  1. 25 0
      docker/parse_output

+ 25 - 0
docker/parse_output

@@ -6,6 +6,7 @@ my $size = 0;
 my $who = '';
 my $mode = '';
 my %res = ();
+my $offlinebytes = 0;
 
 while(<>) {
     $size = "$1|$2" if /===== Running oram (\d+) (\d+)/;
@@ -19,6 +20,19 @@ while(<>) {
             $res{$size}->{$who.$mode} = $1/1000
         }
     }
+    if (/Total Offline Band\(bytes\): (\d+)/) {
+        $offlinebytes = $1;
+    }
+    if (/Total Online Band\(bytes\): (\d+)/) {
+        my $onlinebytes = $1;
+        my $totbytes = $onlinebytes + $offlinebytes;
+        $res{$size}->{'onlbytes'} = 0 unless
+            defined $res{$size}->{'onlbytes'};
+        $res{$size}->{'totbytes'} = 0 unless
+            defined $res{$size}->{'totbytes'};
+        $res{$size}->{'onlbytes'} += $onlinebytes;
+        $res{$size}->{'totbytes'} += $totbytes;
+    }
 }
 
 sub max3 {
@@ -40,3 +54,14 @@ foreach $size (sort keys %res) {
         $res{$size}->{'EETE'});
     print "|$size|$online|$total|", $online/$iters, "|", $total/$iters, "|\n";
 }
+
+print "\n";
+
+print "|size|iters|online_3P_bytes|total_3P_bytes|online_3P_bytes_per_iter|total_3P_bytes_per_iter|\n";
+print "|----|-----|---------------|--------------|------------------------|-----------------------|\n";
+foreach $size (sort keys %res) {
+    my $iters = $1 if $size =~ /\|(\d+)/;
+    my $online = $res{$size}->{'onlbytes'};
+    my $total = $res{$size}->{'totbytes'};
+    print "|$size|$online|$total|", $online/$iters, "|", $total/$iters, "|\n";
+}