=tes,act forward port of metricskit / test stability improvements

Forward port of commits resolving #15165 (histogram overflow and NPE in perf tests)