From 95bbaf4edac720bd98c5f5ec0a00803552be9732 Mon Sep 17 00:00:00 2001 From: Yu Kun Date: Sat, 7 Sep 2019 14:53:01 +0800 Subject: [PATCH] add profiling Former-commit-id: 903596ea8eaa3675d658418f998cce1427ea8e5f --- cpp/cmake/DefineOptions.cmake | 2 +- cpp/src/sdk/examples/grpcsimple/src/ClientTest.cpp | 11 ++++++----- cpp/src/sdk/grpc/ClientProxy.cpp | 2 ++ cpp/src/server/grpc_impl/GrpcRequestTask.cpp | 2 +- cpp/unittest/db/scheduler_test.cpp | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cpp/cmake/DefineOptions.cmake b/cpp/cmake/DefineOptions.cmake index 78043a1aef..1484a9d25f 100644 --- a/cpp/cmake/DefineOptions.cmake +++ b/cpp/cmake/DefineOptions.cmake @@ -96,7 +96,7 @@ define_option(MILVUS_WITH_ZLIB "Build with zlib compression" ON) define_option(MILVUS_WITH_KNOWHERE "Build with Knowhere" OFF) -define_option(MILVUS_ENABLE_PROFILING "Build with profiling" ON) +#define_option(MILVUS_ENABLE_PROFILING "Build with profiling" ON) if(CMAKE_VERSION VERSION_LESS 3.7) set(MILVUS_WITH_ZSTD_DEFAULT OFF) diff --git a/cpp/src/sdk/examples/grpcsimple/src/ClientTest.cpp b/cpp/src/sdk/examples/grpcsimple/src/ClientTest.cpp index 84f40bd40c..1fc1aa4f86 100644 --- a/cpp/src/sdk/examples/grpcsimple/src/ClientTest.cpp +++ b/cpp/src/sdk/examples/grpcsimple/src/ClientTest.cpp @@ -22,9 +22,9 @@ std::string GetTableName(); const std::string TABLE_NAME = GetTableName(); constexpr int64_t TABLE_DIMENSION = 512; -constexpr int64_t TABLE_INDEX_FILE_SIZE = 768; -constexpr int64_t BATCH_ROW_COUNT = 100000; -constexpr int64_t NQ = 100; +constexpr int64_t TABLE_INDEX_FILE_SIZE = 1024; +constexpr int64_t BATCH_ROW_COUNT = 1000000; +constexpr int64_t NQ = 10000; constexpr int64_t TOP_K = 10; constexpr int64_t SEARCH_TARGET = 5000; //change this value, result is different constexpr int64_t ADD_VECTOR_LOOP = 1; @@ -306,7 +306,9 @@ ClientTest::Test(const std::string& address, const std::string& port) { } {//search vectors after build index finish - DoSearch(conn, search_record_array, "Search after build index finish"); + for (uint64_t i = 0; i < 5; ++i) { + DoSearch(conn, search_record_array, "Search after build index finish"); + } // std::cout << conn->DumpTaskTables() << std::endl; } @@ -338,7 +340,6 @@ ClientTest::Test(const std::string& address, const std::string& port) { std::cout << "Server status before disconnect: " << status << std::endl; } Connection::Destroy(conn); -// conn->Disconnect(); {//server status std::string status = conn->ServerStatus(); std::cout << "Server status after disconnect: " << status << std::endl; diff --git a/cpp/src/sdk/grpc/ClientProxy.cpp b/cpp/src/sdk/grpc/ClientProxy.cpp index 2163e78c66..85ae9a34ed 100644 --- a/cpp/src/sdk/grpc/ClientProxy.cpp +++ b/cpp/src/sdk/grpc/ClientProxy.cpp @@ -240,6 +240,7 @@ ClientProxy::Search(const std::string &table_name, //step 3: search vectors ::milvus::grpc::TopKQueryResultList topk_query_result_list; + Status status = client_ptr_->Search(topk_query_result_list, search_param); //step 4: convert result array @@ -254,6 +255,7 @@ ClientProxy::Search(const std::string &table_name, topk_query_result_array.emplace_back(result); } + return status; } catch (std::exception &ex) { diff --git a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp index b3c971649d..16422f6907 100644 --- a/cpp/src/server/grpc_impl/GrpcRequestTask.cpp +++ b/cpp/src/server/grpc_impl/GrpcRequestTask.cpp @@ -14,7 +14,7 @@ #include "GrpcMilvusServer.h" #include "db/Utils.h" #include "scheduler/SchedInst.h" -#include +//#include #include "src/server/Server.h" diff --git a/cpp/unittest/db/scheduler_test.cpp b/cpp/unittest/db/scheduler_test.cpp index dfb90fc3df..b3ec48b593 100644 --- a/cpp/unittest/db/scheduler_test.cpp +++ b/cpp/unittest/db/scheduler_test.cpp @@ -56,7 +56,7 @@ TEST(DBSchedulerTest, TASK_QUEUE_TEST) { ptr = queue.Back(); ASSERT_EQ(ptr->type(), engine::ScheduleTaskType::kIndexLoad); - load_task->Execute(); +// load_task->Execute(); } TEST(DBSchedulerTest, SEARCH_SCHEDULER_TEST) {