588f168164
Adds `--report-metrics` and `--report-all-metrics`. These options print all the Metrics objects exposed by CompilerTask. This CL has counts and durations and adds metrics to two tasks to demonstrate the 'framework'. More task metrics will be implemented as needed. As we do so, we will experiment to see if it is possible to make it easier and more efficient collect metrics. ``` $ dart2js ... --report-metrics Info: Metrics: type_inference.time: 1.429s deferred_load.time: 0.424s ... $ dart2js ... --report-all-metrics Info: Metrics: type_inference.time: 1.300s type_inference.time.analyze: 0.695s type_inference.time.refine1: 0.361s type_inference.time.refine2: 0.175s type_inference.count.exceededMaxChange: 5 type_inference.count.overallRefines: 90827 deferred_load.time: 0.270s deferred_load.hunkListElements: 1 ``` Change-Id: I2ba66f65af604758b0cbd71a688133cb562e32ed Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156842 Reviewed-by: Joshua Litt <joshualitt@google.com> Commit-Queue: Stephen Adams <sra@google.com>