+
+ if (/Generation (\d+):\s*\d+ collections,\s*\d+ parallel,\s*(-*\d+\.\d\d)s\s*,\s*(-*\d+\.\d\d)s elapsed/) {
+ if ($1 == 0) {
+ $Gc0Time = $2; $Gc0Elapsed = $3;
+ } elsif ($1 == 1) {
+ $Gc1Time = $2; $Gc1Elapsed = $3;
+ }
+ }
+
+ if (/work balance: ([0-9.]+)/) {
+ $Balance = $1;
+ }
+
+
+ if ( /CPU GC counters/ ) {
+ # Counters that follow correspond to GC
+ $into_gc_counters = 1;
+ }
+
+ if ( /^\s+\(([A-Z_0-9]+)\)\s+:\s+([0-9,]+)/ ) {
+ $counter = $1;
+ $count = $2;
+ $count =~ s/,//g; # Remove commas in numbers
+ # Pretty printing elements of a list with type [(String,[Float])]
+ # It's a bit lame for passing values but it works.
+ if($into_gc_counters) {
+ $counters = "$counters(\"GC:$counter\",[$count]),";
+ } else {
+ $counters = "$counters(\"$counter\",[$count]),";
+ }
+ }
+
+ if ( /^\s+\(([A-Z_0-9]+)\)\s+\%\s+of\s+\(([A-Z_0-9]+)\)\s+:\s+([0-9.]+)/ ) {
+ $counter = "$1/$2"; # Relative quantity
+ $count = $3;
+ # Pretty printing elements of a list with type [(String,[Float])]
+ # It's a bit lame for passing values but it works.
+ if($into_gc_counters) {
+ $counters = "$counters(\"GC:$counter\",[$count]),";
+ } else {
+ $counters = "$counters(\"$counter\",[$count]),";
+ }
+ }
+