extra: add tests for test::MetricMap, MetricDiff, ratchet.
extra: Add metrics functions to test.
compiletest: Add support for metrics and ratchet modes.
Add configure and make machinery to activate perf metrics and ratchets.
extra: reduce bench loop max time to 3s.
auto merge of #7829 : graydon/rust/codegen-compiletests, r=thestinger

This should get us over the hump of activating basic ratcheting on codegen tests, at least. It also puts in place optional (disabled by default) ratcheting on all #[bench] tests, and records all metrics from them to harvestable .json files in any case.