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

Method onEvent

Disruptor.PerfTests/PingPongSequencedLatencyTest.cpp:78–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 }
77
78 void PingPongSequencedLatencyTest::Pinger::onEvent(ValueEvent& data, std::int64_t /*sequence*/, bool /*endOfBatch*/)
79 {
80 auto t1 = Stopwatch::getTimestamp();
81
82 m_latencyRecorder->record(LatencyTestSession::convertStopwatchTicksToNano((double)(t1 - m_t0)));
83
84 if (data.value < m_maxEvents)
85 {
86 while (m_pauseDurationInNanos > (Stopwatch::getTimestamp() - t1))
87 {
88 std::this_thread::sleep_for(std::chrono::milliseconds(0));
89 }
90
91 send();
92 }
93 else
94 {
95 m_signal->set();
96 }
97 }
98
99 void PingPongSequencedLatencyTest::Pinger::onStart()
100 {

Callers

nothing calls this directly

Calls 4

recordMethod · 0.80
setMethod · 0.45
nextMethod · 0.45
publishMethod · 0.45

Tested by

no test coverage detected