diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | test/src/gtest_dynamic_fieldstat.cpp | 6 | ||||
| -rw-r--r-- | test/src/gtest_fieldstat_topk.cpp | 2 | ||||
| -rw-r--r-- | test/src/test_utils.cpp | 1 |
4 files changed, 11 insertions, 10 deletions
diff --git a/test/src/CMakeLists.txt b/test/src/CMakeLists.txt index 7dafefd..67eda4e 100644 --- a/test/src/CMakeLists.txt +++ b/test/src/CMakeLists.txt @@ -6,17 +6,17 @@ add_definitions(-std=c++11) #add_executable(gtest_rule ${PROJECT_SOURCE_DIR}/src/tsg_rule.cpp ${PROJECT_SOURCE_DIR}/src/tsg_bridge.cpp ${PROJECT_SOURCE_DIR}/src/tsg_leaky_bucket.cpp gtest_common.cpp gtest_rule.cpp) #target_link_libraries(gtest_rule gtest-static ctemplate-static cjson MESA_prof_load MESA_handle_logger MESA_jump_layer MESA_field_stat2 maatframe) -# add_executable(gtest_fieldstat_interface ${SRC} gtest_fieldstat_interface.cpp) -# target_link_libraries(gtest_fieldstat_interface gtest-static heavykeeper) +add_executable(gtest_fieldstat_interface ${SRC} gtest_fieldstat_interface.cpp) +target_link_libraries(gtest_fieldstat_interface gtest-static heavykeeper) add_executable(gtest_fieldstat_counter_output ${SRC} gtest_fieldstat_counter_output.cpp) target_link_libraries(gtest_fieldstat_counter_output gtest-static heavykeeper) -# add_executable(gtest_dynamic_fieldstat ${SRC} gtest_dynamic_fieldstat.cpp) -# target_link_libraries(gtest_dynamic_fieldstat gtest-static heavykeeper) +add_executable(gtest_dynamic_fieldstat ${SRC} gtest_dynamic_fieldstat.cpp) +target_link_libraries(gtest_dynamic_fieldstat gtest-static heavykeeper) -# add_executable(gtest_dynamic_fieldstat_output ${SRC} gtest_dynamic_fieldstat_output.cpp) -# target_link_libraries(gtest_dynamic_fieldstat_output gtest-static heavykeeper) +add_executable(gtest_dynamic_fieldstat_output ${SRC} gtest_dynamic_fieldstat_output.cpp) +target_link_libraries(gtest_dynamic_fieldstat_output gtest-static heavykeeper) add_executable(gtest_fieldstat_output_file_instance ${SRC} gtest_fieldstat_output_file_instance.cpp) target_link_libraries(gtest_fieldstat_output_file_instance gtest-static heavykeeper) diff --git a/test/src/gtest_dynamic_fieldstat.cpp b/test/src/gtest_dynamic_fieldstat.cpp index 28e7f4b..8d8ee69 100644 --- a/test/src/gtest_dynamic_fieldstat.cpp +++ b/test/src/gtest_dynamic_fieldstat.cpp @@ -281,12 +281,15 @@ TEST(FeildStatDynamicAPI, FieldStatDynamicMetricValueSet) ret = fieldstat_dynamic_metric_value_set(instance, FIELD_TYPE_COUNTER, "Traffic_bytes", 10 + i, tags, sizeof(tags)/sizeof(tags[0]), i); EXPECT_EQ(0, ret); } - + printf("value set finish\n"); for(int i = 0; i < n_thread; i++) { + printf("loop :%d\n", i); + head = &instance->n_thread_dynamic_metric[i]; HASH_ITER(hh, *head, dyn_metric, tmp_dyn_metric) { + printf("loop hash\n"); metrics = dyn_metric->metrics; metric = metrics[0]; switch(metric->field_type) @@ -304,6 +307,7 @@ TEST(FeildStatDynamicAPI, FieldStatDynamicMetricValueSet) } } } + printf("done, going to free\n"); fieldstat_dynamic_instance_free(instance); } diff --git a/test/src/gtest_fieldstat_topk.cpp b/test/src/gtest_fieldstat_topk.cpp index 38d71ba..2d7479f 100644 --- a/test/src/gtest_fieldstat_topk.cpp +++ b/test/src/gtest_fieldstat_topk.cpp @@ -26,8 +26,6 @@ Heavy_keeper_tester *Construct_default_tester(int output_window = 1) tester->take_action("field2", "world", 10); tester->take_action("field2", "WORLD", 42); - printf("Construct_default_tester done\n"); - return tester; } diff --git a/test/src/test_utils.cpp b/test/src/test_utils.cpp index 5f082ad..8a7b5cf 100644 --- a/test/src/test_utils.cpp +++ b/test/src/test_utils.cpp @@ -195,7 +195,6 @@ std::string Heavy_keeper_tester::read_from_prometheus(const char *output_file_pa sleep(3); char cmd[128]; sprintf(cmd, "curl -s http://127.0.0.1:%lu/metrics -o %s", portal, output_file_path); - cout << "system " << cmd << endl; system(cmd); std::ifstream ifs(output_file_path); |
