MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / test

Method test

extern/libcds/test/stress/queue/push.cpp:90–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 protected:
89 template <class Queue>
90 void test( Queue& q )
91 {
92 cds_test::thread_pool& pool = get_pool();
93
94 pool.add( new Producer<Queue>( pool, q ), s_nThreadCount );
95
96 size_t nStart = 0;
97 size_t nThreadItemCount = s_nQueueSize / s_nThreadCount;
98 for ( size_t i = 0; i < pool.size(); ++i ) {
99 Producer<Queue>& thread = static_cast<Producer<Queue>&>(pool.get( i ));
100 thread.m_nStartItem = nStart;
101 nStart += nThreadItemCount;
102 thread.m_nEndItem = nStart;
103 }
104
105 s_nQueueSize = nThreadItemCount * s_nThreadCount;
106 propout() << std::make_pair( "thread_count", s_nThreadCount )
107 << std::make_pair( "push_count", s_nQueueSize );
108
109 std::chrono::milliseconds duration = pool.run();
110
111 propout() << std::make_pair( "duration", duration );
112
113 analyze( q );
114
115 propout() << q.statistics();
116 }
117
118 template <class Queue>
119 void analyze( Queue& q )

Callers

nothing calls this directly

Calls 7

make_pairFunction · 0.85
analyzeFunction · 0.85
addMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
runMethod · 0.45
statisticsMethod · 0.45

Tested by

no test coverage detected