Commit 60973da5 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4443 get drd to pass perf tests refs[t:4443]

git-svn-id: file:///svn/toku/tokudb@39647 c7de825b-a66e-492c-adef-691d508d4ae1
parent d34280d3
...@@ -187,7 +187,7 @@ static void *worker(void *arg_v) { ...@@ -187,7 +187,7 @@ static void *worker(void *arg_v) {
} }
} }
unlock_worker_op(we); unlock_worker_op(we);
we->num_operations_completed++; (void) __sync_fetch_and_add(&we->num_operations_completed, 1);
if (arg->sleep_ms) { if (arg->sleep_ms) {
usleep(arg->sleep_ms * 1000); usleep(arg->sleep_ms * 1000);
} }
...@@ -410,7 +410,7 @@ static int UU() ptquery_op_no_check(DB_TXN *txn, ARG arg, void* UU(operation_ext ...@@ -410,7 +410,7 @@ static int UU() ptquery_op_no_check(DB_TXN *txn, ARG arg, void* UU(operation_ext
} }
static int UU() cursor_create_close_op(DB_TXN *txn, ARG arg, void* UU(operation_extra)) { static int UU() cursor_create_close_op(DB_TXN *txn, ARG arg, void* UU(operation_extra)) {
int db_index = arg->num_DBs > 1 ? random()%arg->num_DBs : 0; int db_index = arg->num_DBs > 1 ? myrandom_r(arg->random_data)%arg->num_DBs : 0;
DB* db = arg->dbp[db_index]; DB* db = arg->dbp[db_index];
DBC* cursor = NULL; DBC* cursor = NULL;
int r = db->cursor(db, txn, &cursor, 0); assert(r == 0); int r = db->cursor(db, txn, &cursor, 0); assert(r == 0);
...@@ -753,30 +753,30 @@ static void *test_time(void *arg) { ...@@ -753,30 +753,30 @@ static void *test_time(void *arg) {
memset(num_operations_completed_total, 0, sizeof num_operations_completed_total); memset(num_operations_completed_total, 0, sizeof num_operations_completed_total);
for (int i = 0; i < num_seconds; i += tte->performance_period) { for (int i = 0; i < num_seconds; i += tte->performance_period) {
usleep(tte->performance_period*1000*1000); usleep(tte->performance_period*1000*1000);
int total_operations_in_period = 0; int64_t total_operations_in_period = 0;
for (int we = 0; we < tte->num_wes; ++we) { for (int we = 0; we < tte->num_wes; ++we) {
int last = num_operations_completed_total[we]; int64_t last = num_operations_completed_total[we];
int current = __sync_fetch_and_add(&tte->wes[we].num_operations_completed, 0); int64_t current = __sync_fetch_and_add(&tte->wes[we].num_operations_completed, 0);
if (tte->print_thread_performance) { if (tte->print_thread_performance) {
printf("Thread %d Iteration %d Operations %d\n", we, i, current - last); printf("Thread %d Iteration %d Operations %"PRId64"\n", we, i, current - last);
} }
total_operations_in_period += (current - last); total_operations_in_period += (current - last);
num_operations_completed_total[we] = current; num_operations_completed_total[we] = current;
} }
if (tte->print_performance) { if (tte->print_performance) {
printf("Iteration %d Total_Operations %d\n", i, total_operations_in_period); printf("Iteration %d Total_Operations %"PRId64"\n", i, total_operations_in_period);
} }
} }
int total_operations_in_test = 0; int64_t total_operations_in_test = 0;
for (int we = 0; we < tte->num_wes; ++we) { for (int we = 0; we < tte->num_wes; ++we) {
int current = __sync_fetch_and_add(&tte->wes[we].num_operations_completed, 0); int64_t current = __sync_fetch_and_add(&tte->wes[we].num_operations_completed, 0);
if (tte->print_thread_performance) { if (tte->print_thread_performance) {
printf("TOTAL Thread %d Operations %d\n", we, current); printf("TOTAL Thread %d Operations %"PRId64"\n", we, current);
} }
total_operations_in_test += current; total_operations_in_test += current;
} }
if (tte->print_performance) { if (tte->print_performance) {
printf("Total_Operations %d\n", total_operations_in_test); printf("Total_Operations %"PRId64"\n", total_operations_in_test);
} }
if (verbose) { if (verbose) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment