diff options
Diffstat (limited to 'test/benchmark/benchmark_hs_gtest.cpp')
| -rw-r--r-- | test/benchmark/benchmark_hs_gtest.cpp | 424 |
1 files changed, 212 insertions, 212 deletions
diff --git a/test/benchmark/benchmark_hs_gtest.cpp b/test/benchmark/benchmark_hs_gtest.cpp index caa6d28..55801c7 100644 --- a/test/benchmark/benchmark_hs_gtest.cpp +++ b/test/benchmark/benchmark_hs_gtest.cpp @@ -25,14 +25,14 @@ #define ARRAY_SIZE 10 #define PERF_THREAD_NUM 5 -#define MAX_SCAN_COUNT 1000000 +#define MAX_SCAN_TIMES 1000000 const char *table_info_path = "./benchmark_table_info.conf"; struct log_handle *g_logger = NULL; struct thread_param { int thread_id; - int test_count; + int test_times; int rule_count; struct maat *maat_inst; const char *table_name; @@ -182,7 +182,7 @@ void *perf_regex_scan_thread(void *arg) int table_id = maat_get_table_id(maat_inst, table_name); clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { int ret = maat_scan_string(maat_inst, table_id, scan_data, strlen(scan_data), results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -195,7 +195,7 @@ void *perf_regex_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = (hit_times == param->test_count ? 1 : 0); + *is_all_hit = (hit_times == param->test_times ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d regex_scan time_elapse:%lldms hit_times:%d", param->thread_id, param->rule_count, param->time_elapse_ms, hit_times); @@ -246,7 +246,7 @@ void *perf_literal_scan_thread(void *arg) int table_id = maat_get_table_id(maat_inst, table_name); clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { int ret = maat_scan_string(maat_inst, table_id, scan_data, strlen(scan_data), results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -259,7 +259,7 @@ void *perf_literal_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = (hit_times == param->test_count ? 1 : 0); + *is_all_hit = (hit_times == param->test_times ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d literal_scan time_elapse:%lldms hit_times:%d", param->thread_id, param->rule_count, param->time_elapse_ms, hit_times); @@ -311,7 +311,7 @@ void *perf_stream_scan_thread(void *arg) struct maat_stream *sp = maat_stream_new(maat_inst, table_id, state); clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { ret = maat_stream_scan(sp, scan_data, strlen(scan_data), results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -326,7 +326,7 @@ void *perf_stream_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = ((hit_times == param->test_count) ? 1 : 0); + *is_all_hit = ((hit_times == param->test_times) ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d stream_scan time_elapse:%lldms hit_times:%d", @@ -354,7 +354,7 @@ void *perf_ip_scan_thread(void *arg) int proto = 6; clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { int ret = maat_scan_ipv4(maat_inst, table_id, ip_addr, port, proto, results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -367,7 +367,7 @@ void *perf_ip_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = (hit_times == param->test_count ? 1 : 0); + *is_all_hit = (hit_times == param->test_times ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d ip_scan time_elapse:%lldms hit_times:%d", param->thread_id, param->rule_count, param->time_elapse_ms, hit_times); @@ -420,7 +420,7 @@ void *perf_integer_scan_thread(void *arg) long long scan_data = 1000000; clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { int ret = maat_scan_integer(maat_inst, table_id, scan_data, results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -433,7 +433,7 @@ void *perf_integer_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = (hit_times == param->test_count ? 1 : 0); + *is_all_hit = (hit_times == param->test_times ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d integer_scan time_elapse:%lldms hit_times:%d", param->thread_id, param->rule_count, param->time_elapse_ms, hit_times); @@ -482,7 +482,7 @@ void *perf_flag_scan_thread(void *arg) long long scan_data = 1000000; clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < param->test_count; i++) { + for (int i = 0; i < param->test_times; i++) { int ret = maat_scan_flag(maat_inst, table_id, scan_data, results, ARRAY_SIZE, &n_hit_result, state); if (ret == MAAT_SCAN_HIT) { @@ -495,7 +495,7 @@ void *perf_flag_scan_thread(void *arg) param->time_elapse_ms = (end.tv_sec - start.tv_sec) * 1000 + (end.tv_nsec - start.tv_nsec) / 1000000; int *is_all_hit = ALLOC(int, 1); - *is_all_hit = (hit_times == param->test_count ? 1 : 0); + *is_all_hit = (hit_times == param->test_times ? 1 : 0); log_info(param->logger, MODULE_BENCHMARK_GTEST, "thread_id:%d rule_count:%d flag_scan time_elapse:%lldms hit_times:%d", param->thread_id, param->rule_count, param->time_elapse_ms, hit_times); @@ -587,7 +587,7 @@ TEST_F(Regex100BenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 100; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -595,24 +595,24 @@ TEST_F(Regex100BenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex100Scan match rate on %d-threads speed %lld lookups/s/thread", @@ -679,7 +679,7 @@ TEST_F(Regex200BenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 200; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -687,24 +687,24 @@ TEST_F(Regex200BenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex200Scan match rate on %d-threads speed %lld lookups/s/thread", @@ -771,7 +771,7 @@ TEST_F(Regex300BenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 300; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -779,24 +779,24 @@ TEST_F(Regex300BenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex300Scan match rate on %d-threads speed %lld lookups/s/thread", @@ -863,7 +863,7 @@ TEST_F(Regex500BenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 500; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -871,24 +871,24 @@ TEST_F(Regex500BenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex500Scan match rate on %d-threads speed %lld lookups/s/thread", @@ -955,7 +955,7 @@ TEST_F(Regex1KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -963,24 +963,24 @@ TEST_F(Regex1KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex1KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1047,7 +1047,7 @@ TEST_F(Regex2KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 2000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1055,24 +1055,24 @@ TEST_F(Regex2KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex2KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1139,7 +1139,7 @@ TEST_F(Regex3KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 3000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1147,24 +1147,24 @@ TEST_F(Regex3KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex3KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1231,7 +1231,7 @@ TEST_F(Regex5KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1239,24 +1239,24 @@ TEST_F(Regex5KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex5KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1323,7 +1323,7 @@ TEST_F(Regex10KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1331,24 +1331,24 @@ TEST_F(Regex10KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex10KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1415,7 +1415,7 @@ TEST_F(Regex15KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 15000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1423,24 +1423,24 @@ TEST_F(Regex15KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_regex_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_regex_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Regex15KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1508,7 +1508,7 @@ TEST_F(Expr1KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1516,24 +1516,24 @@ TEST_F(Expr1KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr1KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1601,7 +1601,7 @@ TEST_F(Expr5KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1609,24 +1609,24 @@ TEST_F(Expr5KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr5KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1694,7 +1694,7 @@ TEST_F(Expr10KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1702,24 +1702,24 @@ TEST_F(Expr10KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr10KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1787,7 +1787,7 @@ TEST_F(Expr50KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 50000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1795,24 +1795,24 @@ TEST_F(Expr50KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr50KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1880,7 +1880,7 @@ TEST_F(Expr100KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 100000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1888,24 +1888,24 @@ TEST_F(Expr100KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr100KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -1973,7 +1973,7 @@ TEST_F(Expr500KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 500000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -1981,24 +1981,24 @@ TEST_F(Expr500KBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr500KLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2066,7 +2066,7 @@ TEST_F(Expr1MBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2074,24 +2074,24 @@ TEST_F(Expr1MBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr1MLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2159,7 +2159,7 @@ TEST_F(Expr2MBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 2000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2167,24 +2167,24 @@ TEST_F(Expr2MBenchmarkGTest, LiteralScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_literal_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_literal_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Expr2MLiteralScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2252,7 +2252,7 @@ TEST_F(Stream1KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2263,18 +2263,18 @@ TEST_F(Stream1KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream1KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2342,7 +2342,7 @@ TEST_F(Stream5KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2353,18 +2353,18 @@ TEST_F(Stream5KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream5KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2432,7 +2432,7 @@ TEST_F(Stream10KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2443,18 +2443,18 @@ TEST_F(Stream10KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream10KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2522,7 +2522,7 @@ TEST_F(Stream50KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 50000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2533,18 +2533,18 @@ TEST_F(Stream50KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream50KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2612,7 +2612,7 @@ TEST_F(Stream100KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 100000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2623,18 +2623,18 @@ TEST_F(Stream100KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream100KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2702,7 +2702,7 @@ TEST_F(Stream500KBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 500000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2713,18 +2713,18 @@ TEST_F(Stream500KBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream500KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2792,7 +2792,7 @@ TEST_F(Stream1MBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2803,18 +2803,18 @@ TEST_F(Stream1MBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream1MScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2882,7 +2882,7 @@ TEST_F(Stream2MBenchmarkGTest, LiteralScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 2000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2893,18 +2893,18 @@ TEST_F(Stream2MBenchmarkGTest, LiteralScan) { } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Stream2MScan match rate on %d-threads speed %lld lookups/s/thread", @@ -2970,7 +2970,7 @@ TEST_F(IP1KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -2978,24 +2978,24 @@ TEST_F(IP1KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP1KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3061,7 +3061,7 @@ TEST_F(IP5KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3069,24 +3069,24 @@ TEST_F(IP5KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP5KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3152,7 +3152,7 @@ TEST_F(IP10KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3160,24 +3160,24 @@ TEST_F(IP10KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP10KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3243,7 +3243,7 @@ TEST_F(IP50KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 50000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3251,24 +3251,24 @@ TEST_F(IP50KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP50KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3334,7 +3334,7 @@ TEST_F(IP100KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 100000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3342,24 +3342,24 @@ TEST_F(IP100KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP100KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3425,7 +3425,7 @@ TEST_F(IP500KBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 500000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3433,24 +3433,24 @@ TEST_F(IP500KBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP500KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3516,7 +3516,7 @@ TEST_F(IP1MBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3524,24 +3524,24 @@ TEST_F(IP1MBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP1MScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3607,7 +3607,7 @@ TEST_F(IP5MBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3615,24 +3615,24 @@ TEST_F(IP5MBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP5MScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3698,7 +3698,7 @@ TEST_F(IP10MBenchmarkGTest, IPScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3706,24 +3706,24 @@ TEST_F(IP10MBenchmarkGTest, IPScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_ip_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_ip_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "IP10MScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3789,7 +3789,7 @@ TEST_F(Integer1KBenchmarkGTest, IntegerScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3797,24 +3797,24 @@ TEST_F(Integer1KBenchmarkGTest, IntegerScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_integer_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_integer_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Integer1KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3880,7 +3880,7 @@ TEST_F(Integer5KBenchmarkGTest, IntegerScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3888,24 +3888,24 @@ TEST_F(Integer5KBenchmarkGTest, IntegerScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_integer_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_integer_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Integer5KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -3971,7 +3971,7 @@ TEST_F(Integer10KBenchmarkGTest, IntegerScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -3979,24 +3979,24 @@ TEST_F(Integer10KBenchmarkGTest, IntegerScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_integer_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_integer_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Integer10KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -4062,7 +4062,7 @@ TEST_F(Flag1KBenchmarkGTest, FlagScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 1000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -4070,24 +4070,24 @@ TEST_F(Flag1KBenchmarkGTest, FlagScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_flag_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_flag_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Flag1KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -4153,7 +4153,7 @@ TEST_F(Flag5KBenchmarkGTest, FlagScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 5000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -4161,24 +4161,24 @@ TEST_F(Flag5KBenchmarkGTest, FlagScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_flag_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_flag_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Flag5KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -4244,7 +4244,7 @@ TEST_F(Flag10KBenchmarkGTest, FlagScan) { thread_params[i].maat_inst = maat_inst; thread_params[i].thread_id = i; thread_params[i].table_name = table_name; - thread_params[i].test_count = MAX_SCAN_COUNT; + thread_params[i].test_times = MAX_SCAN_TIMES; thread_params[i].rule_count = 10000; thread_params[i].time_elapse_ms = 0; thread_params[i].logger = logger; @@ -4252,24 +4252,24 @@ TEST_F(Flag10KBenchmarkGTest, FlagScan) { if (i < PERF_THREAD_NUM) { pthread_create(&threads[i], NULL, perf_flag_scan_thread, thread_params+i); } else { - thread_params[i].test_count = 0; + thread_params[i].test_times = 0; pthread_create(&threads[i], NULL, perf_flag_update_thread, thread_params+i); } } long long time_elapse_ms = 0; - long long scan_count = 0; + long long scan_times = 0; long long scan_per_second = 0; for (i = 0; i < PERF_THREAD_NUM + 1; i++) { pthread_join(threads[i], (void **)&is_all_hit); time_elapse_ms += thread_params[i].time_elapse_ms; - scan_count += thread_params[i].test_count; + scan_times += thread_params[i].test_times; EXPECT_EQ(*is_all_hit, 1); *is_all_hit = 0; free(is_all_hit); } - scan_per_second = scan_count * 1000 / time_elapse_ms; + scan_per_second = scan_times * 1000 / time_elapse_ms; log_info(maat_inst->logger, MODULE_BENCHMARK_GTEST, "Flag10KScan match rate on %d-threads speed %lld lookups/s/thread", @@ -4286,4 +4286,4 @@ int main(int argc, char ** argv) log_handle_destroy(g_logger); return ret; -}
\ No newline at end of file +} |
