#!/bin/bash
{
tail -n 4 *.err \
  | sed -n 's/^==> pe-\([^-]*\)-\([0-9]*\)threads-.*/test = "\1"; threads = \2;/p;
            s/.* Summary of timings (ms): \(.*\)/timings = \1;/p;
            s/.* \([1-9][0-9]*\)maxresident.*/maxrss = \1;/p;
            s/.*+\([1-9][0-9]*\)minor.*/minor = \1; results.iteration(test, threads, timings, maxrss, minor)/p'
fgrep 'gc_tot_load
elapsed_time' *.gcstats | sed 's/pe-\([^-]*\)-\([0-9]*\)threads.*[^0-9.]\([0-9.]*\)%$/results.gctotal("\1", \2, \3)/
                               s|pe-\([^-]*\)-\([0-9]*\)threads.*:\([^/]*\)/elapsed_time.*[^0-9.]\([0-9.]*\) MB/s$|results.gcalloc("\1", \2, "\3", \4)|'
} >all.js
