metrics/rta: save the list of live things in files
authorJean Privat <jean@pryen.org>
Wed, 12 Mar 2014 17:44:07 +0000 (13:44 -0400)
committerJean Privat <jean@pryen.org>
Wed, 12 Mar 2014 22:26:51 +0000 (18:26 -0400)
Simply use `live_types_to_csv` and `live_methods_to_tree` to produce
two files in the correct output directory.

This helps the debugging of engines when RTA is buggy or misused.

Signed-off-by: Jean Privat <jean@pryen.org>

src/metrics/rta_metrics.nit

index 7feb836..d274207 100644 (file)
@@ -79,6 +79,15 @@ private class RTAMetricsPhase
                gmetrics.collect(mtypes)
                gmetrics.to_console(1, not toolcontext.opt_nocolors.value)
                if csv then gmetrics.to_csv.save("{out}/complexity.csv")
+
+               # dump type and method infos
+               if csv then
+                       analysis.live_types_to_csv.save("{out}/rta_types.csv")
+
+                       var s = new OFStream.open("{out}/rta_methods.dat")
+                       analysis.live_methods_to_tree.pretty(s)
+                       s.close
+               end
        end
 end