MCPcopy Create free account
hub / github.com/apache/brpc / read_dbd

Function read_dbd

test/brpc_load_balancer_unittest.cpp:223–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222template<typename DBD>
223void* read_dbd(void* void_arg) {
224 auto args = (PerfArgs<DBD>*)void_arg;
225 args->ready = true;
226 butil::Timer t;
227 while (!g_stopped) {
228 if (g_started) {
229 break;
230 }
231 bthread_usleep(10);
232 }
233 t.start();
234 while (!g_stopped) {
235 {
236 typename DBD::ScopedPtr ptr;
237 args->dbd->Read(&ptr);
238 // ptr->find(1);
239 }
240 ++args->counter;
241 }
242 t.stop();
243 args->elapse_ns = t.n_elapsed();
244 return NULL;
245}
246
247template<typename DBD>
248void PerfTest(int thread_num, bool modify_during_reading) {

Callers

nothing calls this directly

Calls 5

bthread_usleepFunction · 0.85
n_elapsedMethod · 0.80
startMethod · 0.45
ReadMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected