MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/benchmark/wiredtiger/main.cpp:263–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263int main(int argc, char* argv[]) {
264 const char* dbpath = "./db";
265 int ch, max = 1000, nthread = 1;
266 acl::string action("get");
267
268 while ((ch = getopt(argc, argv, "hn:a:c:i:")) > 0) {
269 switch (ch) {
270 case 'h':
271 usage(argv[0]);
272 return 0;
273 case 'n':
274 max = atoi(optarg);
275 break;
276 case 'a':
277 action = optarg;
278 break;
279 case 'c':
280 nthread = atoi(optarg);
281 break;
282 case 'i':
283 __inter = atoi(optarg);
284 break;
285 default:
286 break;
287 }
288 }
289
290 acl::string path;
291 path << dbpath;
292 wdb db(path);
293 if (!db.open()) {
294 printf("open db(%s) error\r\n", dbpath);
295 return 1;
296 }
297
298 std::vector<acl::thread*> threads;
299 for (int i = 0; i < nthread; i++) {
300 acl::thread* thr = new db_thread(i, db, action, max);
301 threads.push_back(thr);
302 thr->start();
303 }
304
305 for (std::vector<acl::thread*>::iterator it = threads.begin();
306 it != threads.end(); ++it) {
307 (*it)->wait();
308 delete *it;
309 }
310
311 return 0;
312}

Callers

nothing calls this directly

Calls 8

beginMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
openMethod · 0.45
push_backMethod · 0.45
startMethod · 0.45
endMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…