Selaa lähdekoodia

Parse the times of a set of Floram runs

Ian Goldberg 1 vuosi sitten
vanhempi
commit
fed2da5a7b
1 muutettua tiedostoa jossa 33 lisäystä ja 0 poistoa
  1. 33 0
      parse_times

+ 33 - 0
parse_times

@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $mode = '';
+my $depth = 0;
+my $who = 0;
+my @seconds = (0, 0);
+
+while(<>) {
+    chomp;
+    if (/===== Running floram (\S+) (\d+)/) {
+        $mode = $1;
+        $depth = $2;
+        @seconds = (0,0);
+        next;
+    }
+    if (/===== P([01]) output/) {
+        $who = $1;
+        next;
+    }
+    if (/Total time: (\d+\.?\d*) s/) {
+        $seconds[$who] = $1;
+    }
+    if (/===== End/) {
+        # The setupsize and opsize are the _sum_ for the two parties, so
+        # add them to get the total size for both parties, and divide by
+        # 2 to get the average size for each party
+        my $maxsecs = $seconds[0];
+        $maxsecs = $seconds[1] if $seconds[1] > $maxsecs;
+        print "$depth $maxsecs\n";
+    }
+}