diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c')
-rw-r--r-- | src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c index 3bee610bfa6..93fb94836c0 100644 --- a/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt2853_perf/main.c @@ -1,5 +1,5 @@ /*- - * Public Domain 2014-2017 MongoDB, Inc. + * Public Domain 2014-2018 MongoDB, Inc. * Public Domain 2008-2014 WiredTiger, Inc. * * This is free and unencumbered software released into the public domain. @@ -97,12 +97,15 @@ main(int argc, char *argv[]) sharedopts->bloom = BLOOM; testutil_check(testutil_parse_opts(argc, argv, opts)); testutil_make_work_dir(opts->home); + testutil_progress(opts, "start"); testutil_check(wiredtiger_open(opts->home, NULL, "create,cache_size=1G", &opts->conn)); + testutil_progress(opts, "wiredtiger_open"); testutil_check( opts->conn->open_session(opts->conn, NULL, NULL, &session)); + testutil_progress(opts, "sessions opened"); /* * Note: id is repeated as id2. This makes it easier to @@ -143,6 +146,7 @@ main(int argc, char *argv[]) testutil_check(maincur->insert(maincur)); testutil_check(maincur->close(maincur)); testutil_check(session->close(session, NULL)); + testutil_progress(opts, "setup complete"); for (i = 0; i < N_INSERT_THREAD; ++i) { insert_args[i].threadnum = i; @@ -161,6 +165,7 @@ main(int argc, char *argv[]) testutil_check(pthread_create( &get_tid[i], NULL, thread_get, &get_args[i])); } + testutil_progress(opts, "threads started"); /* * Wait for insert threads to finish. When they @@ -175,6 +180,7 @@ main(int argc, char *argv[]) for (i = 0; i < N_GET_THREAD; ++i) testutil_check(pthread_join(get_tid[i], NULL)); + testutil_progress(opts, "threads joined"); fprintf(stderr, "\n"); for (i = 0; i < N_GET_THREAD; ++i) { fprintf(stderr, " thread %d did %d joins (%d fails)\n", i, @@ -183,7 +189,10 @@ main(int argc, char *argv[]) } testutil_assert(nfail == 0); + testutil_progress(opts, "cleanup starting"); +#if 0 testutil_cleanup(opts); +#endif return (0); } @@ -212,6 +221,7 @@ thread_insert(void *arg) testutil_check(session->open_cursor(session, opts->uri, NULL, NULL, &maincur)); + testutil_progress(opts, "insert start"); for (i = 0; i < N_INSERT; i++) { /* * Insert threads may stomp on each other's records; @@ -242,6 +252,7 @@ thread_insert(void *arg) fprintf(stderr, "."); (void)time(&curtime); if ((elapsed = difftime(curtime, prevtime)) > 5.0) { + testutil_progress(opts, "insert time gap"); fprintf(stderr, "\n" "GAP: %.0f secs after %d inserts\n", elapsed, i); @@ -250,6 +261,7 @@ thread_insert(void *arg) prevtime = curtime; } } + testutil_progress(opts, "insert end"); testutil_check(maincur->close(maincur)); testutil_check(session->close(session, NULL)); return (NULL); @@ -281,6 +293,7 @@ thread_get(void *arg) testutil_check(session->open_cursor( session, sharedopts->posturi, NULL, NULL, &postcur)); + testutil_progress(opts, "get start"); for (threadargs->njoins = 0; threadargs->done == 0; threadargs->njoins++) { testutil_check(session->begin_transaction(session, NULL)); @@ -290,20 +303,14 @@ thread_get(void *arg) testutil_check(postcur->get_key(postcur, &post)); testutil_check(postcur->get_value(postcur, &post2, &bal, &extra, &flag, &key)); - testutil_assert(post == post2); - if (post != 54321) - break; + testutil_assert((flag > 0 && bal < 0) || + (flag == 0 && bal >= 0)); maincur->set_key(maincur, key); testutil_check(maincur->search(maincur)); testutil_check(maincur->get_value(maincur, &post2, &bal2, &extra, &flag2, &key2)); testutil_check(maincur->reset(maincur)); - testutil_assert(key == key2); - testutil_assert(post == post2); - testutil_assert(bal == bal2); - testutil_assert(flag == flag2); - testutil_assert((flag2 > 0 && bal2 < 0) || (flag2 == 0 && bal2 >= 0)); } @@ -318,6 +325,7 @@ thread_get(void *arg) (void)time(&curtime); if ((elapsed = difftime(curtime, prevtime)) > 5.0) { + testutil_progress(opts, "get time gap"); fprintf(stderr, "\n" "GAP: %.0f secs after %d gets\n", elapsed, threadargs->njoins); @@ -325,6 +333,7 @@ thread_get(void *arg) } prevtime = curtime; } + testutil_progress(opts, "get end"); testutil_check(postcur->close(postcur)); testutil_check(maincur->close(maincur)); testutil_check(session->close(session, NULL)); |