+
+ 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]),";
+ }
+ }
+