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

Method test

extern/libcds/test/stress/pqueue/push.cpp:98–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97 template <class PQueue>
98 void test( PQueue& q )
99 {
100 cds_test::thread_pool& pool = get_pool();
101 pool.add( new Producer<PQueue>( pool, q ), s_nThreadCount );
102
103 size_t nStart = 0;
104 size_t nThreadItemCount = s_nQueueSize / s_nThreadCount;
105 s_nQueueSize = nThreadItemCount * s_nThreadCount;
106
107 for ( size_t i = 0; i < pool.size(); ++i ) {
108 static_cast<Producer<PQueue>&>(pool.get( i )).prepare( nStart, nStart + nThreadItemCount );
109 nStart += nThreadItemCount;
110 }
111
112 propout() << std::make_pair( "thread_count", s_nThreadCount )
113 << std::make_pair( "push_count", s_nQueueSize );
114
115 std::chrono::milliseconds duration = pool.run();
116 propout() << std::make_pair( "duration", duration );
117
118 analyze( q );
119
120 propout() << q.statistics();
121 }
122
123 public:
124 static void SetUpTestCase()

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected