Fix #7459, add #[bench] metric-capture and ratchets, activate codegen test ratchet

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.