MCPcopy Create free account
hub / github.com/apache/qpid-proton / run

Method run

tests/include/catch.hpp:7316–7347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7314
7315 template <typename Clock = default_clock>
7316 void run() {
7317 IConfigPtr cfg = getCurrentContext().getConfig();
7318
7319 auto env = Detail::measure_environment<Clock>();
7320
7321 getResultCapture().benchmarkPreparing(name);
7322 CATCH_TRY{
7323 auto plan = user_code([&] {
7324 return prepare<Clock>(*cfg, env);
7325 });
7326
7327 BenchmarkInfo info {
7328 name,
7329 plan.estimated_duration.count(),
7330 plan.iterations_per_sample,
7331 cfg->benchmarkSamples(),
7332 cfg->benchmarkResamples(),
7333 env.clock_resolution.mean.count(),
7334 env.clock_cost.mean.count()
7335 };
7336
7337 getResultCapture().benchmarkStarting(info);
7338
7339 auto samples = user_code([&] {
7340 return plan.template run<Clock>(*cfg, env);
7341 });
7342
7343 auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
7344 BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
7345 getResultCapture().benchmarkEnded(stats);
7346
7347 } CATCH_CATCH_ALL{
7348 if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
7349 std::rethrow_exception(std::current_exception());
7350 }

Callers

nothing calls this directly

Calls 10

user_codeFunction · 0.85
analyseFunction · 0.85
countMethod · 0.80
benchmarkSamplesMethod · 0.80
benchmarkResamplesMethod · 0.80
benchmarkPreparingMethod · 0.45
benchmarkStartingMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
benchmarkEndedMethod · 0.45

Tested by

no test coverage detected