parse_times 755 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/perl
  2. use strict;
  3. my $mode = '';
  4. my $depth = 0;
  5. my $who = 0;
  6. my @seconds = (0, 0);
  7. while(<>) {
  8. chomp;
  9. if (/===== Running floram (\S+) (\d+)/) {
  10. $mode = $1;
  11. $depth = $2;
  12. @seconds = (0,0);
  13. next;
  14. }
  15. if (/===== P([01]) output/) {
  16. $who = $1;
  17. next;
  18. }
  19. if (/Total time: (\d+\.?\d*) s/) {
  20. $seconds[$who] = $1;
  21. }
  22. if (/===== End/) {
  23. # The setupsize and opsize are the _sum_ for the two parties, so
  24. # add them to get the total size for both parties, and divide by
  25. # 2 to get the average size for each party
  26. my $maxsecs = $seconds[0];
  27. $maxsecs = $seconds[1] if $seconds[1] > $maxsecs;
  28. print "$depth $maxsecs\n";
  29. }
  30. }