MCPcopy Create free account
hub / github.com/Abc-Arbitrage/Disruptor-cpp / run

Method run

Disruptor.PerfTests/ThroughputTestSession.cpp:25–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 void ThroughputTestSession::run()
26 {
27 auto testInstance = m_testInfo.factory();
28
29 checkProcessorsRequirements(testInstance);
30
31 std::cout << "Throughput Test to run => " << m_testInfo.name << ", Runs => " << m_runs << std::endl;
32 std::cout << "Starting throughput tests" << std::endl;
33
34 Stopwatch stopwatch;
35
36 for (auto i = 0; i < m_runs; i++)
37 {
38 stopwatch.reset();
39
40 std::int64_t totalOperationsInRun;
41
42 try
43 {
44 totalOperationsInRun = testInstance->run(stopwatch);
45 }
46 catch (std::exception& ex)
47 {
48 ThroughputTestSessionResult result(ex);
49 std::cout << result.toString() << std::endl;
50
51 m_results.push_back(result);
52 continue;
53 }
54
55 ThroughputTestSessionResult result(totalOperationsInRun, stopwatch.elapsed());
56 std::cout << result.toString() << std::endl;
57
58 m_results.push_back(result);
59 }
60 }
61
62 std::int64_t ThroughputTestSession::getAverageThroughput()
63 {

Callers

nothing calls this directly

Calls 3

elapsedMethod · 0.80
resetMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected