| 221 | |
| 222 | template<typename DBD> |
| 223 | void* 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 | |
| 247 | template<typename DBD> |
| 248 | void PerfTest(int thread_num, bool modify_during_reading) { |
nothing calls this directly
no test coverage detected